content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# THIS FILE IS AUTO-GENERATED, DO NOT EDIT config = {'all': {'comment': 'Entry point', 'type': 'nested', 'lists': ['2', '3', '4'], 'ensure_unique': True, 'ensure_unique_prefix': 4, 'max_slug_length': 50}, '2': {'comment': 'Two words (may also contain prepositions)', 'type': 'nested', 'lists': ['an']}, '3': {'comment': 'Three words (may also contain prepositions)', 'type': 'nested', 'lists': ['aan', 'ano', 'anl', 'nuo', 'as2', 's2o', 's2l', 'sl2']}, '4': {'comment': 'Four words (may also contain prepositions)', 'type': 'nested', 'lists': ['aano', 'aanl', 'anuo', 'as2o', 's2uo', 'as2l', 'asl2']}, 'an': {'comment': 'adjective-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj']}, 'aan': {'comment': 'adjective-adjective-noun', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj']}, 'ano': {'comment': 'adjective-noun-of-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'of', 'of_noun_any']}, 'anl': {'comment': 'adjective-noun-from-location', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'from', 'from_noun_no_mod']}, 'nuo': {'comment': 'noun-of-adjective-noun', 'type': 'cartesian', 'lists': ['subj', 'of', 'of_modifier', 'of_noun']}, 'as2': {'comment': 'adjective-2word-subject', 'type': 'cartesian', 'lists': ['adj_far', 'subj2']}, 's2o': {'comment': '2word-subject-of-noun', 'type': 'cartesian', 'lists': ['subj2', 'of', 'of_noun_any']}, 's2l': {'comment': '2word-subject-from-location', 'type': 'cartesian', 'lists': ['subj2', 'from', 'from_noun_no_mod']}, 'sl2': {'comment': 'subject-from-some-location', 'type': 'cartesian', 'lists': ['subj', 'from', 'from2']}, 'aano': {'comment': 'adjective-adjective-noun-of-noun', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj', 'of', 'of_noun_any']}, 'aanl': {'comment': 'adjective-adjective-noun-from-location', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj', 'from', 'from_noun_no_mod']}, 'anuo': {'comment': 'adjective-noun-of-adjective-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'of', 'of_modifier', 'of_noun']}, 'as2o': {'comment': 'adjective-2word-subject-of-noun', 'type': 'cartesian', 'lists': ['adj_far', 'subj2', 'of', 'of_noun_any']}, 's2uo': {'comment': 'adjective-2word-subject-of-adjective-noun', 'type': 'cartesian', 'lists': ['subj2', 'of', 'of_modifier', 'of_noun']}, 'as2l': {'comment': 'adjective-2word-subject-from-location', 'type': 'cartesian', 'lists': ['adj_far', 'subj2', 'from', 'from_noun_no_mod']}, 'asl2': {'comment': 'adjective-subject-from-some-location', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'from', 'from2']}, 'adj_far': {'comment': 'First adjective (with more following)', 'type': 'nested', 'lists': ['adjective', 'adjective_first', 'noun_adjective', 'size']}, 'adj_near': {'comment': 'Last adjective (closest to the subject)', 'type': 'nested', 'lists': ['adjective', 'color', 'noun_adjective', 'prefix']}, 'adj_any': {'comment': 'The only adjective (includes everything)', 'type': 'nested', 'lists': ['adjective', 'color', 'noun_adjective', 'prefix', 'size']}, 'subj': {'comment': 'The subject (animal)', 'type': 'nested', 'lists': ['animal', 'animal_breed', 'animal_legendary']}, 'of': {'type': 'const', 'value': 'of'}, 'of_noun_any': {'type': 'nested', 'lists': ['of_noun', 'of_noun_no_mod']}, 'from': {'type': 'const', 'value': 'from'}, 'from_noun_no_mod': {'type': 'words', 'words': ['venus', 'mars', 'jupiter', 'ganymede', 'saturn', 'uranus', 'neptune', 'pluto', 'betelgeuse', 'sirius', 'vega', 'arcadia', 'asgard', 'atlantis', 'avalon', 'camelot', 'eldorado', 'heaven', 'hell', 'hyperborea', 'lemuria', 'nibiru', 'shambhala', 'tartarus', 'valhalla', 'wonderland']}, 'prefix': {'type': 'words', 'words': ['giga', 'mega', 'micro', 'mini', 'nano', 'pygmy', 'super', 'uber', 'ultra', 'cyber', 'mutant', 'ninja', 'space'], 'max_length': 13}, 'of_modifier': {'type': 'words', 'words': ['absolute', 'abstract', 'algebraic', 'amazing', 'amusing', 'ancient', 'angelic', 'astonishing', 'authentic', 'awesome', 'beautiful', 'classic', 'delightful', 'demonic', 'eminent', 'enjoyable', 'eternal', 'excellent', 'exotic', 'extreme', 'fabulous', 'famous', 'fantastic', 'fascinating', 'flawless', 'fortunate', 'glorious', 'great', 'heavenly', 'holistic', 'hypothetical', 'ideal', 'illegal', 'imaginary', 'immense', 'imminent', 'immortal', 'impossible', 'impressive', 'improbable', 'incredible', 'inescapable', 'inevitable', 'infinite', 'inspiring', 'interesting', 'legal', 'magic', 'majestic', 'major', 'marvelous', 'massive', 'mysterious', 'nonconcrete', 'nonstop', 'luxurious', 'optimal', 'original', 'pastoral', 'perfect', 'perpetual', 'phenomenal', 'pleasurable', 'pragmatic', 'premium', 'radical', 'rampant', 'regular', 'remarkable', 'satisfying', 'serious', 'scientific', 'sexy', 'sheer', 'simple', 'silent', 'spectacular', 'splendid', 'stereotyped', 'stimulating', 'strange', 'striking', 'strongest', 'sublime', 'sudden', 'terrific', 'therapeutic', 'total', 'ultimate', 'uncanny', 'undeniable', 'unearthly', 'unexpected', 'unknown', 'unmatched', 'unnatural', 'unreal', 'unusual', 'utter', 'weird', 'wonderful', 'wondrous'], 'max_length': 13}, 'animal_breed': {'type': 'words', 'words': ['longhorn', 'akita', 'beagle', 'bloodhound', 'bulldog', 'chihuahua', 'collie', 'corgi', 'dalmatian', 'doberman', 'husky', 'labradoodle', 'labrador', 'mastiff', 'malamute', 'mongrel', 'poodle', 'rottweiler', 'spaniel', 'terrier', 'mule', 'mustang', 'pony', 'angora'], 'max_length': 13}, 'size': {'type': 'words', 'words': ['big', 'colossal', 'enormous', 'gigantic', 'great', 'huge', 'hulking', 'humongous', 'large', 'little', 'massive', 'miniature', 'petite', 'portable', 'small', 'tiny', 'towering'], 'max_length': 13}, 'from2': {'type': 'phrases', 'phrases': [('fancy', 'cafe'), ('prestigious', 'college'), ('prestigious', 'university'), ('big', 'city'), ('foreign', 'country'), ('small', 'town'), ('wild', 'west'), ('ancient', 'ruins'), ('another', 'dimension'), ('another', 'planet'), ('flying', 'circus'), ('secret', 'laboratory'), ('the', 'government'), ('the', 'future'), ('the', 'past'), ('the', 'stars')], 'number_of_words': 2, 'max_length': 24}, 'of_noun_no_mod': {'type': 'words', 'words': ['chemistry', 'education', 'experiment', 'mathematics', 'psychology', 'reading', 'cubism', 'painting', 'advertising', 'agreement', 'climate', 'competition', 'effort', 'emphasis', 'foundation', 'judgment', 'memory', 'opportunity', 'perspective', 'priority', 'promise', 'teaching'], 'max_length': 13}, 'of_noun': {'type': 'words', 'words': ['anger', 'bliss', 'contentment', 'courage', 'ecstasy', 'excitement', 'faith', 'felicity', 'fury', 'gaiety', 'glee', 'glory', 'greatness', 'inspiration', 'jest', 'joy', 'happiness', 'holiness', 'love', 'merriment', 'passion', 'patience', 'peace', 'persistence', 'pleasure', 'pride', 'recreation', 'relaxation', 'romance', 'serenity', 'tranquility', 'apotheosis', 'chaos', 'energy', 'essence', 'eternity', 'excellence', 'experience', 'freedom', 'nirvana', 'order', 'perfection', 'spirit', 'variation', 'acceptance', 'brotherhood', 'criticism', 'culture', 'discourse', 'discussion', 'justice', 'piety', 'respect', 'security', 'support', 'tolerance', 'trust', 'warranty', 'abundance', 'admiration', 'assurance', 'authority', 'awe', 'certainty', 'control', 'domination', 'enterprise', 'fame', 'grandeur', 'influence', 'luxury', 'management', 'opposition', 'plenty', 'popularity', 'prestige', 'prosperity', 'reputation', 'reverence', 'reward', 'superiority', 'triumph', 'wealth', 'acumen', 'aptitude', 'art', 'artistry', 'competence', 'efficiency', 'expertise', 'finesse', 'genius', 'leadership', 'perception', 'skill', 'virtuosity', 'argument', 'debate', 'action', 'agility', 'amplitude', 'attack', 'charisma', 'chivalry', 'defense', 'defiance', 'devotion', 'dignity', 'endurance', 'exercise', 'force', 'fortitude', 'gallantry', 'health', 'honor', 'infinity', 'inquire', 'intensity', 'luck', 'mastery', 'might', 'opportunity', 'penetration', 'performance', 'pluck', 'potency', 'protection', 'prowess', 'resistance', 'serendipity', 'speed', 'stamina', 'strength', 'swiftness', 'temperance', 'tenacity', 'valor', 'vigor', 'vitality', 'will', 'advance', 'conversion', 'correction', 'development', 'diversity', 'elevation', 'enhancement', 'enrichment', 'enthusiasm', 'focus', 'fruition', 'growth', 'improvement', 'innovation', 'modernism', 'novelty', 'proficiency', 'progress', 'promotion', 'realization', 'refinement', 'renovation', 'revolution', 'success', 'tempering', 'upgrade', 'ampleness', 'completion', 'satiation', 'saturation', 'sufficiency', 'vastness', 'wholeness', 'attraction', 'beauty', 'bloom', 'cleaning', 'courtesy', 'glamour', 'elegance', 'fascination', 'kindness', 'joviality', 'politeness', 'refinement', 'symmetry', 'sympathy', 'tact', 'calibration', 'drama', 'economy', 'engineering', 'examination', 'philosophy', 'poetry', 'research', 'science', 'democracy', 'election', 'feminism', 'champagne', 'coffee', 'cookies', 'flowers', 'fragrance', 'honeydew', 'music', 'pizza', 'aurora', 'blizzard', 'current', 'dew', 'downpour', 'drizzle', 'hail', 'hurricane', 'lightning', 'rain', 'snow', 'storm', 'sunshine', 'tempest', 'thunder', 'tornado', 'typhoon', 'weather', 'wind', 'whirlwind', 'abracadabra', 'adventure', 'atheism', 'camouflage', 'destiny', 'endeavor', 'expression', 'fantasy', 'fertility', 'imagination', 'karma', 'masquerade', 'maturity', 'radiance', 'shopping', 'sorcery', 'unity', 'witchcraft', 'wizardry', 'wonder', 'youth', 'purring'], 'max_length': 13}, 'subj2': {'type': 'phrases', 'phrases': [('atlantic', 'puffin'), ('bank', 'swallow'), ('barn', 'owl'), ('barn', 'swallow'), ('barred', 'owl'), ('chimney', 'swift'), ('cliff', 'swallow'), ('emperor', 'goose'), ('harlequin', 'duck'), ('himalayan', 'snowcock'), ('hyacinth', 'macaw'), ('mangrove', 'cuckoo'), ('mute', 'swan'), ('northern', 'cardinal'), ('peregrine', 'falcon'), ('prairie', 'falcon'), ('red', 'cardinal'), ('snow', 'goose'), ('snowy', 'owl'), ('trumpeter', 'swan'), ('tufted', 'puffin'), ('whooper', 'swan'), ('whooping', 'crane'), ('fire', 'ant'), ('alpine', 'chipmunk'), ('beaked', 'whale'), ('bottlenose', 'dolphin'), ('clouded', 'leopard'), ('eared', 'seal'), ('elephant', 'seal'), ('feral', 'cat'), ('feral', 'dog'), ('feral', 'donkey'), ('feral', 'goat'), ('feral', 'horse'), ('feral', 'pig'), ('fur', 'seal'), ('grizzly', 'bear'), ('harbor', 'porpoise'), ('honey', 'badger'), ('humpback', 'whale'), ('killer', 'whale'), ('mountain', 'deer'), ('mountain', 'goat'), ('mountain', 'lion'), ('olympic', 'marmot'), ('pampas', 'deer'), ('pine', 'marten'), ('polynesian', 'rat'), ('rhesus', 'macaque'), ('river', 'dolphin'), ('sea', 'lion'), ('sea', 'otter'), ('snow', 'leopard'), ('sperm', 'whale'), ('spinner', 'dolphin'), ('vampire', 'bat'), ('gila', 'monster'), ('freshwater', 'crocodile'), ('saltwater', 'crocodile'), ('snapping', 'turtle'), ('walking', 'mushroom')], 'number_of_words': 2, 'max_length': 22}, 'adjective': {'type': 'words', 'words': ['acrid', 'ambrosial', 'amorphous', 'armored', 'aromatic', 'bald', 'blazing', 'boisterous', 'bouncy', 'brawny', 'bulky', 'camouflaged', 'caped', 'chubby', 'curvy', 'elastic', 'ethereal', 'fat', 'feathered', 'fiery', 'flashy', 'flat', 'fluffy', 'foamy', 'fragrant', 'furry', 'fuzzy', 'glaring', 'hairy', 'heavy', 'hissing', 'horned', 'icy', 'imaginary', 'invisible', 'lean', 'loud', 'loutish', 'lumpy', 'lush', 'masked', 'meaty', 'messy', 'misty', 'nebulous', 'noisy', 'nondescript', 'organic', 'purring', 'quiet', 'quirky', 'radiant', 'roaring', 'ruddy', 'rustling', 'screeching', 'shaggy', 'shapeless', 'shiny', 'silent', 'silky', 'singing', 'skinny', 'smooth', 'soft', 'spicy', 'spiked', 'statuesque', 'sticky', 'tacky', 'tall', 'tangible', 'tentacled', 'thick', 'thundering', 'venomous', 'warm', 'weightless', 'whispering', 'winged', 'wooden', 'adorable', 'affable', 'amazing', 'amiable', 'attractive', 'beautiful', 'calm', 'charming', 'cherubic', 'classic', 'classy', 'convivial', 'cordial', 'cuddly', 'curly', 'cute', 'debonair', 'elegant', 'famous', 'fresh', 'friendly', 'funny', 'gorgeous', 'graceful', 'gregarious', 'grinning', 'handsome', 'hilarious', 'hot', 'interesting', 'kind', 'laughing', 'lovely', 'meek', 'mellow', 'merciful', 'neat', 'nifty', 'notorious', 'poetic', 'pretty', 'refined', 'refreshing', 'sexy', 'smiling', 'sociable', 'spiffy', 'stylish', 'sweet', 'tactful', 'whimsical', 'abiding', 'accurate', 'adamant', 'adaptable', 'adventurous', 'alluring', 'aloof', 'ambitious', 'amusing', 'annoying', 'arrogant', 'aspiring', 'belligerent', 'benign', 'berserk', 'benevolent', 'bold', 'brave', 'cheerful', 'chirpy', 'cocky', 'congenial', 'courageous', 'cryptic', 'curious', 'daft', 'dainty', 'daring', 'defiant', 'delicate', 'delightful', 'determined', 'devout', 'didactic', 'diligent', 'discreet', 'dramatic', 'dynamic', 'eager', 'eccentric', 'elated', 'encouraging', 'enigmatic', 'enthusiastic', 'evasive', 'faithful', 'fair', 'fanatic', 'fearless', 'fervent', 'festive', 'fierce', 'fine', 'free', 'gabby', 'garrulous', 'gay', 'gentle', 'glistening', 'greedy', 'grumpy', 'happy', 'honest', 'hopeful', 'hospitable', 'impetuous', 'independent', 'industrious', 'innocent', 'intrepid', 'jolly', 'jovial', 'just', 'lively', 'loose', 'loyal', 'merry', 'modest', 'mysterious', 'nice', 'obedient', 'optimistic', 'orthodox', 'outgoing', 'outrageous', 'overjoyed', 'passionate', 'perky', 'placid', 'polite', 'positive', 'proud', 'prudent', 'puzzling', 'quixotic', 'quizzical', 'rebel', 'resolute', 'rampant', 'righteous', 'romantic', 'rough', 'rousing', 'sassy', 'satisfied', 'sly', 'sincere', 'snobbish', 'spirited', 'spry', 'stalwart', 'stirring', 'swinging', 'tasteful', 'thankful', 'tidy', 'tremendous', 'truthful', 'unselfish', 'upbeat', 'uppish', 'valiant', 'vehement', 'vengeful', 'vigorous', 'vivacious', 'zealous', 'zippy', 'able', 'adept', 'analytic', 'astute', 'attentive', 'brainy', 'busy', 'calculating', 'capable', 'careful', 'cautious', 'certain', 'clever', 'competent', 'conscious', 'cooperative', 'crafty', 'crazy', 'cunning', 'daffy', 'devious', 'discerning', 'efficient', 'expert', 'functional', 'gifted', 'helpful', 'enlightened', 'idealistic', 'impartial', 'industrious', 'ingenious', 'inquisitive', 'intelligent', 'inventive', 'judicious', 'keen', 'knowing', 'literate', 'logical', 'masterful', 'mindful', 'nonchalant', 'observant', 'omniscient', 'poised', 'practical', 'pragmatic', 'proficient', 'provocative', 'qualified', 'radical', 'rational', 'realistic', 'resourceful', 'savvy', 'sceptical', 'sensible', 'serious', 'shrewd', 'skilled', 'slick', 'slim', 'sloppy', 'smart', 'sophisticated', 'stoic', 'succinct', 'talented', 'thoughtful', 'tricky', 'unbiased', 'uptight', 'versatile', 'versed', 'visionary', 'wise', 'witty', 'accelerated', 'active', 'agile', 'athletic', 'dashing', 'deft', 'dexterous', 'energetic', 'fast', 'frisky', 'hasty', 'hypersonic', 'meteoric', 'mighty', 'muscular', 'nimble', 'nippy', 'powerful', 'prompt', 'quick', 'rapid', 'resilient', 'robust', 'rugged', 'solid', 'speedy', 'steadfast', 'steady', 'strong', 'sturdy', 'tireless', 'tough', 'unyielding', 'rich', 'wealthy', 'meticulous', 'precise', 'rigorous', 'scrupulous', 'strict', 'airborne', 'burrowing', 'crouching', 'flying', 'hidden', 'hopping', 'jumping', 'lurking', 'tunneling', 'warping', 'aboriginal', 'amphibian', 'aquatic', 'arboreal', 'polar', 'terrestrial', 'urban', 'accomplished', 'astonishing', 'authentic', 'awesome', 'delectable', 'excellent', 'exotic', 'exuberant', 'fabulous', 'fantastic', 'fascinating', 'flawless', 'fortunate', 'funky', 'godlike', 'glorious', 'groovy', 'honored', 'illustrious', 'imposing', 'important', 'impressive', 'incredible', 'invaluable', 'kickass', 'majestic', 'magnificent', 'marvellous', 'monumental', 'perfect', 'phenomenal', 'pompous', 'precious', 'premium', 'private', 'remarkable', 'spectacular', 'splendid', 'successful', 'wonderful', 'wondrous', 'offbeat', 'original', 'outstanding', 'quaint', 'unique', 'ancient', 'antique', 'prehistoric', 'primitive', 'abstract', 'acoustic', 'angelic', 'arcane', 'archetypal', 'augmented', 'auspicious', 'axiomatic', 'beneficial', 'bipedal', 'bizarre', 'complex', 'dancing', 'dangerous', 'demonic', 'divergent', 'economic', 'electric', 'elite', 'eminent', 'enchanted', 'esoteric', 'finicky', 'fractal', 'futuristic', 'gainful', 'hallowed', 'heavenly', 'heretic', 'holistic', 'hungry', 'hypnotic', 'hysterical', 'illegal', 'imperial', 'imported', 'impossible', 'inescapable', 'juicy', 'liberal', 'ludicrous', 'lyrical', 'magnetic', 'manipulative', 'mature', 'military', 'macho', 'married', 'melodic', 'natural', 'naughty', 'nocturnal', 'nostalgic', 'optimal', 'pastoral', 'peculiar', 'piquant', 'pristine', 'prophetic', 'psychedelic', 'quantum', 'rare', 'real', 'secret', 'simple', 'spectral', 'spiritual', 'stereotyped', 'stimulating', 'straight', 'strange', 'tested', 'therapeutic', 'true', 'ubiquitous', 'uncovered', 'unnatural', 'utopian', 'vagabond', 'vague', 'vegan', 'victorious', 'vigilant', 'voracious', 'wakeful', 'wandering', 'watchful', 'wild', 'bright', 'brilliant', 'colorful', 'crystal', 'dark', 'dazzling', 'fluorescent', 'glittering', 'glossy', 'gleaming', 'light', 'mottled', 'neon', 'opalescent', 'pastel', 'smoky', 'sparkling', 'spotted', 'striped', 'translucent', 'transparent', 'vivid'], 'max_length': 13}, 'animal': {'type': 'words', 'words': ['earthworm', 'leech', 'worm', 'scorpion', 'spider', 'tarantula', 'barnacle', 'crab', 'crayfish', 'lobster', 'pillbug', 'prawn', 'shrimp', 'ant', 'bee', 'beetle', 'bug', 'bumblebee', 'butterfly', 'caterpillar', 'cicada', 'cricket', 'dragonfly', 'earwig', 'firefly', 'grasshopper', 'honeybee', 'hornet', 'inchworm', 'ladybug', 'locust', 'mantis', 'mayfly', 'mosquito', 'moth', 'sawfly', 'silkworm', 'termite', 'wasp', 'woodlouse', 'centipede', 'millipede', 'pronghorn', 'antelope', 'bison', 'buffalo', 'bull', 'chamois', 'cow', 'gazelle', 'gaur', 'goat', 'ibex', 'impala', 'kudu', 'markhor', 'mouflon', 'muskox', 'nyala', 'sheep', 'wildebeest', 'yak', 'zebu', 'alpaca', 'camel', 'llama', 'vicugna', 'caribou', 'chital', 'deer', 'elk', 'moose', 'pudu', 'reindeer', 'sambar', 'wapiti', 'beluga', 'dolphin', 'narwhal', 'orca', 'porpoise', 'whale', 'donkey', 'horse', 'stallion', 'zebra', 'giraffe', 'okapi', 'hippo', 'rhino', 'boar', 'hog', 'pig', 'swine', 'warthog', 'peccary', 'buzzard', 'eagle', 'goshawk', 'harrier', 'hawk', 'vulture', 'duck', 'goose', 'swan', 'teal', 'bird', 'hummingbird', 'swift', 'kiwi', 'potoo', 'seriema', 'cassowary', 'emu', 'condor', 'auk', 'avocet', 'guillemot', 'kittiwake', 'puffin', 'seagull', 'skua', 'stork', 'dodo', 'dove', 'pigeon', 'kingfisher', 'tody', 'bustard', 'coua', 'coucal', 'cuckoo', 'koel', 'malkoha', 'roadrunner', 'kagu', 'caracara', 'falcon', 'kestrel', 'chachalaca', 'chicken', 'curassow', 'grouse', 'guan', 'junglefowl', 'partridge', 'peacock', 'pheasant', 'quail', 'rooster', 'turkey', 'loon', 'coot', 'crane', 'turaco', 'hoatzin', 'bullfinch', 'crow', 'jackdaw', 'jaybird', 'finch', 'lyrebird', 'magpie', 'myna', 'nightingale', 'nuthatch', 'oriole', 'oxpecker', 'raven', 'robin', 'rook', 'skylark', 'sparrow', 'starling', 'swallow', 'waxbill', 'wren', 'heron', 'ibis', 'jacamar', 'piculet', 'toucan', 'toucanet', 'woodpecker', 'flamingo', 'grebe', 'albatross', 'fulmar', 'petrel', 'spoonbill', 'ara', 'cockatoo', 'kakapo', 'lorikeet', 'macaw', 'parakeet', 'parrot', 'penguin', 'ostrich', 'boobook', 'owl', 'booby', 'cormorant', 'frigatebird', 'pelican', 'quetzal', 'trogon', 'axolotl', 'bullfrog', 'frog', 'newt', 'salamander', 'toad', 'angelfish', 'barracuda', 'carp', 'catfish', 'dogfish', 'goldfish', 'guppy', 'eel', 'flounder', 'herring', 'lionfish', 'mackerel', 'oarfish', 'perch', 'salmon', 'seahorse', 'sturgeon', 'sunfish', 'tench', 'trout', 'tuna', 'wrasse', 'sawfish', 'shark', 'stingray', 'jellyfish', 'alligator', 'caiman', 'crocodile', 'gharial', 'starfish', 'urchin', 'hedgehog', 'coyote', 'dingo', 'dog', 'fennec', 'fox', 'hound', 'jackal', 'tanuki', 'wolf', 'bobcat', 'caracal', 'cat', 'cougar', 'jaguar', 'jaguarundi', 'leopard', 'lion', 'lynx', 'manul', 'ocelot', 'panther', 'puma', 'serval', 'smilodon', 'tiger', 'wildcat', 'aardwolf', 'binturong', 'cheetah', 'civet', 'fossa', 'hyena', 'meerkat', 'mongoose', 'badger', 'coati', 'ermine', 'ferret', 'marten', 'mink', 'otter', 'polecat', 'skunk', 'stoat', 'weasel', 'wolverine', 'seal', 'walrus', 'raccoon', 'ringtail', 'bear', 'panda', 'bat', 'armadillo', 'elephant', 'mammoth', 'mastodon', 'mole', 'hyrax', 'bandicoot', 'bettong', 'cuscus', 'kangaroo', 'koala', 'numbat', 'quokka', 'quoll', 'wallaby', 'wombat', 'echidna', 'platypus', 'tapir', 'anteater', 'sloth', 'agouti', 'beaver', 'capybara', 'chinchilla', 'chipmunk', 'degu', 'dormouse', 'gerbil', 'gopher', 'groundhog', 'jackrabbit', 'jerboa', 'hamster', 'hare', 'lemming', 'marmot', 'mouse', 'muskrat', 'porcupine', 'rabbit', 'rat', 'squirrel', 'vole', 'ape', 'baboon', 'bonobo', 'capuchin', 'chimpanzee', 'galago', 'gibbon', 'gorilla', 'lemur', 'lori', 'macaque', 'mandrill', 'marmoset', 'monkey', 'orangutan', 'tamarin', 'tarsier', 'uakari', 'dugong', 'manatee', 'shrew', 'aardwark', 'clam', 'cockle', 'mussel', 'oyster', 'scallop', 'shellfish', 'ammonite', 'cuttlefish', 'nautilus', 'octopus', 'squid', 'limpet', 'slug', 'snail', 'sponge', 'tuatara', 'agama', 'chameleon', 'dragon', 'gecko', 'iguana', 'lizard', 'pogona', 'skink', 'adder', 'anaconda', 'asp', 'boa', 'cobra', 'copperhead', 'mamba', 'python', 'rattlesnake', 'sidewinder', 'snake', 'taipan', 'viper', 'tortoise', 'turtle', 'dinosaur', 'raptor', 'mushroom'], 'max_length': 13}, 'color': {'type': 'words', 'words': ['almond', 'amaranth', 'apricot', 'artichoke', 'auburn', 'azure', 'banana', 'beige', 'black', 'blond', 'blue', 'brown', 'burgundy', 'carmine', 'carrot', 'celadon', 'cerise', 'cerulean', 'charcoal', 'cherry', 'chestnut', 'chocolate', 'cinnamon', 'copper', 'cream', 'crimson', 'cyan', 'daffodil', 'dandelion', 'denim', 'ebony', 'eggplant', 'gray', 'ginger', 'green', 'indigo', 'infrared', 'jasmine', 'khaki', 'lavender', 'lilac', 'mauve', 'magenta', 'mahogany', 'maize', 'marigold', 'mustard', 'ochre', 'orange', 'papaya', 'peach', 'persimmon', 'pink', 'pistachio', 'pumpkin', 'purple', 'raspberry', 'red', 'rose', 'russet', 'saffron', 'sage', 'scarlet', 'sepia', 'silver', 'tan', 'tangerine', 'taupe', 'teal', 'tomato', 'turquoise', 'tuscan', 'ultramarine', 'ultraviolet', 'umber', 'vanilla', 'vermilion', 'violet', 'viridian', 'white', 'wine', 'wisteria', 'yellow', 'agate', 'amber', 'amethyst', 'aquamarine', 'asparagus', 'beryl', 'brass', 'bronze', 'cobalt', 'coral', 'cornflower', 'diamond', 'emerald', 'garnet', 'golden', 'granite', 'ivory', 'jade', 'jasper', 'lemon', 'lime', 'malachite', 'maroon', 'myrtle', 'nickel', 'olive', 'olivine', 'onyx', 'opal', 'orchid', 'pearl', 'peridot', 'platinum', 'quartz', 'ruby', 'sandy', 'sapphire', 'steel', 'thistle', 'topaz', 'tourmaline', 'tungsten', 'xanthic', 'zircon'], 'max_length': 13}, 'noun_adjective': {'type': 'words', 'words': ['fancy', 'magic', 'rainbow', 'woodoo'], 'max_length': 13}, 'animal_legendary': {'type': 'words', 'words': ['basilisk', 'chupacabra', 'dragon', 'griffin', 'pegasus', 'unicorn'], 'max_length': 13}, 'adjective_first': {'type': 'words', 'words': ['first', 'new'], 'max_length': 13}} # Python 2 compatibility - all words must be unicode # (this is to make Python 2 and 3 both work from the same __init__.py code) try: for listdef in config.values(): if listdef['type'] == 'words': listdef['words'] = [unicode(x) for x in listdef['words']] elif listdef['type'] == 'phrases': listdef['phrases'] = [tuple(unicode(y) for y in x) for x in listdef['phrases']] elif listdef['type'] == 'const': listdef['value'] = unicode(listdef['value']) except NameError: pass
config = {'all': {'comment': 'Entry point', 'type': 'nested', 'lists': ['2', '3', '4'], 'ensure_unique': True, 'ensure_unique_prefix': 4, 'max_slug_length': 50}, '2': {'comment': 'Two words (may also contain prepositions)', 'type': 'nested', 'lists': ['an']}, '3': {'comment': 'Three words (may also contain prepositions)', 'type': 'nested', 'lists': ['aan', 'ano', 'anl', 'nuo', 'as2', 's2o', 's2l', 'sl2']}, '4': {'comment': 'Four words (may also contain prepositions)', 'type': 'nested', 'lists': ['aano', 'aanl', 'anuo', 'as2o', 's2uo', 'as2l', 'asl2']}, 'an': {'comment': 'adjective-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj']}, 'aan': {'comment': 'adjective-adjective-noun', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj']}, 'ano': {'comment': 'adjective-noun-of-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'of', 'of_noun_any']}, 'anl': {'comment': 'adjective-noun-from-location', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'from', 'from_noun_no_mod']}, 'nuo': {'comment': 'noun-of-adjective-noun', 'type': 'cartesian', 'lists': ['subj', 'of', 'of_modifier', 'of_noun']}, 'as2': {'comment': 'adjective-2word-subject', 'type': 'cartesian', 'lists': ['adj_far', 'subj2']}, 's2o': {'comment': '2word-subject-of-noun', 'type': 'cartesian', 'lists': ['subj2', 'of', 'of_noun_any']}, 's2l': {'comment': '2word-subject-from-location', 'type': 'cartesian', 'lists': ['subj2', 'from', 'from_noun_no_mod']}, 'sl2': {'comment': 'subject-from-some-location', 'type': 'cartesian', 'lists': ['subj', 'from', 'from2']}, 'aano': {'comment': 'adjective-adjective-noun-of-noun', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj', 'of', 'of_noun_any']}, 'aanl': {'comment': 'adjective-adjective-noun-from-location', 'type': 'cartesian', 'lists': ['adj_far', 'adj_near', 'subj', 'from', 'from_noun_no_mod']}, 'anuo': {'comment': 'adjective-noun-of-adjective-noun', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'of', 'of_modifier', 'of_noun']}, 'as2o': {'comment': 'adjective-2word-subject-of-noun', 'type': 'cartesian', 'lists': ['adj_far', 'subj2', 'of', 'of_noun_any']}, 's2uo': {'comment': 'adjective-2word-subject-of-adjective-noun', 'type': 'cartesian', 'lists': ['subj2', 'of', 'of_modifier', 'of_noun']}, 'as2l': {'comment': 'adjective-2word-subject-from-location', 'type': 'cartesian', 'lists': ['adj_far', 'subj2', 'from', 'from_noun_no_mod']}, 'asl2': {'comment': 'adjective-subject-from-some-location', 'type': 'cartesian', 'lists': ['adj_any', 'subj', 'from', 'from2']}, 'adj_far': {'comment': 'First adjective (with more following)', 'type': 'nested', 'lists': ['adjective', 'adjective_first', 'noun_adjective', 'size']}, 'adj_near': {'comment': 'Last adjective (closest to the subject)', 'type': 'nested', 'lists': ['adjective', 'color', 'noun_adjective', 'prefix']}, 'adj_any': {'comment': 'The only adjective (includes everything)', 'type': 'nested', 'lists': ['adjective', 'color', 'noun_adjective', 'prefix', 'size']}, 'subj': {'comment': 'The subject (animal)', 'type': 'nested', 'lists': ['animal', 'animal_breed', 'animal_legendary']}, 'of': {'type': 'const', 'value': 'of'}, 'of_noun_any': {'type': 'nested', 'lists': ['of_noun', 'of_noun_no_mod']}, 'from': {'type': 'const', 'value': 'from'}, 'from_noun_no_mod': {'type': 'words', 'words': ['venus', 'mars', 'jupiter', 'ganymede', 'saturn', 'uranus', 'neptune', 'pluto', 'betelgeuse', 'sirius', 'vega', 'arcadia', 'asgard', 'atlantis', 'avalon', 'camelot', 'eldorado', 'heaven', 'hell', 'hyperborea', 'lemuria', 'nibiru', 'shambhala', 'tartarus', 'valhalla', 'wonderland']}, 'prefix': {'type': 'words', 'words': ['giga', 'mega', 'micro', 'mini', 'nano', 'pygmy', 'super', 'uber', 'ultra', 'cyber', 'mutant', 'ninja', 'space'], 'max_length': 13}, 'of_modifier': {'type': 'words', 'words': ['absolute', 'abstract', 'algebraic', 'amazing', 'amusing', 'ancient', 'angelic', 'astonishing', 'authentic', 'awesome', 'beautiful', 'classic', 'delightful', 'demonic', 'eminent', 'enjoyable', 'eternal', 'excellent', 'exotic', 'extreme', 'fabulous', 'famous', 'fantastic', 'fascinating', 'flawless', 'fortunate', 'glorious', 'great', 'heavenly', 'holistic', 'hypothetical', 'ideal', 'illegal', 'imaginary', 'immense', 'imminent', 'immortal', 'impossible', 'impressive', 'improbable', 'incredible', 'inescapable', 'inevitable', 'infinite', 'inspiring', 'interesting', 'legal', 'magic', 'majestic', 'major', 'marvelous', 'massive', 'mysterious', 'nonconcrete', 'nonstop', 'luxurious', 'optimal', 'original', 'pastoral', 'perfect', 'perpetual', 'phenomenal', 'pleasurable', 'pragmatic', 'premium', 'radical', 'rampant', 'regular', 'remarkable', 'satisfying', 'serious', 'scientific', 'sexy', 'sheer', 'simple', 'silent', 'spectacular', 'splendid', 'stereotyped', 'stimulating', 'strange', 'striking', 'strongest', 'sublime', 'sudden', 'terrific', 'therapeutic', 'total', 'ultimate', 'uncanny', 'undeniable', 'unearthly', 'unexpected', 'unknown', 'unmatched', 'unnatural', 'unreal', 'unusual', 'utter', 'weird', 'wonderful', 'wondrous'], 'max_length': 13}, 'animal_breed': {'type': 'words', 'words': ['longhorn', 'akita', 'beagle', 'bloodhound', 'bulldog', 'chihuahua', 'collie', 'corgi', 'dalmatian', 'doberman', 'husky', 'labradoodle', 'labrador', 'mastiff', 'malamute', 'mongrel', 'poodle', 'rottweiler', 'spaniel', 'terrier', 'mule', 'mustang', 'pony', 'angora'], 'max_length': 13}, 'size': {'type': 'words', 'words': ['big', 'colossal', 'enormous', 'gigantic', 'great', 'huge', 'hulking', 'humongous', 'large', 'little', 'massive', 'miniature', 'petite', 'portable', 'small', 'tiny', 'towering'], 'max_length': 13}, 'from2': {'type': 'phrases', 'phrases': [('fancy', 'cafe'), ('prestigious', 'college'), ('prestigious', 'university'), ('big', 'city'), ('foreign', 'country'), ('small', 'town'), ('wild', 'west'), ('ancient', 'ruins'), ('another', 'dimension'), ('another', 'planet'), ('flying', 'circus'), ('secret', 'laboratory'), ('the', 'government'), ('the', 'future'), ('the', 'past'), ('the', 'stars')], 'number_of_words': 2, 'max_length': 24}, 'of_noun_no_mod': {'type': 'words', 'words': ['chemistry', 'education', 'experiment', 'mathematics', 'psychology', 'reading', 'cubism', 'painting', 'advertising', 'agreement', 'climate', 'competition', 'effort', 'emphasis', 'foundation', 'judgment', 'memory', 'opportunity', 'perspective', 'priority', 'promise', 'teaching'], 'max_length': 13}, 'of_noun': {'type': 'words', 'words': ['anger', 'bliss', 'contentment', 'courage', 'ecstasy', 'excitement', 'faith', 'felicity', 'fury', 'gaiety', 'glee', 'glory', 'greatness', 'inspiration', 'jest', 'joy', 'happiness', 'holiness', 'love', 'merriment', 'passion', 'patience', 'peace', 'persistence', 'pleasure', 'pride', 'recreation', 'relaxation', 'romance', 'serenity', 'tranquility', 'apotheosis', 'chaos', 'energy', 'essence', 'eternity', 'excellence', 'experience', 'freedom', 'nirvana', 'order', 'perfection', 'spirit', 'variation', 'acceptance', 'brotherhood', 'criticism', 'culture', 'discourse', 'discussion', 'justice', 'piety', 'respect', 'security', 'support', 'tolerance', 'trust', 'warranty', 'abundance', 'admiration', 'assurance', 'authority', 'awe', 'certainty', 'control', 'domination', 'enterprise', 'fame', 'grandeur', 'influence', 'luxury', 'management', 'opposition', 'plenty', 'popularity', 'prestige', 'prosperity', 'reputation', 'reverence', 'reward', 'superiority', 'triumph', 'wealth', 'acumen', 'aptitude', 'art', 'artistry', 'competence', 'efficiency', 'expertise', 'finesse', 'genius', 'leadership', 'perception', 'skill', 'virtuosity', 'argument', 'debate', 'action', 'agility', 'amplitude', 'attack', 'charisma', 'chivalry', 'defense', 'defiance', 'devotion', 'dignity', 'endurance', 'exercise', 'force', 'fortitude', 'gallantry', 'health', 'honor', 'infinity', 'inquire', 'intensity', 'luck', 'mastery', 'might', 'opportunity', 'penetration', 'performance', 'pluck', 'potency', 'protection', 'prowess', 'resistance', 'serendipity', 'speed', 'stamina', 'strength', 'swiftness', 'temperance', 'tenacity', 'valor', 'vigor', 'vitality', 'will', 'advance', 'conversion', 'correction', 'development', 'diversity', 'elevation', 'enhancement', 'enrichment', 'enthusiasm', 'focus', 'fruition', 'growth', 'improvement', 'innovation', 'modernism', 'novelty', 'proficiency', 'progress', 'promotion', 'realization', 'refinement', 'renovation', 'revolution', 'success', 'tempering', 'upgrade', 'ampleness', 'completion', 'satiation', 'saturation', 'sufficiency', 'vastness', 'wholeness', 'attraction', 'beauty', 'bloom', 'cleaning', 'courtesy', 'glamour', 'elegance', 'fascination', 'kindness', 'joviality', 'politeness', 'refinement', 'symmetry', 'sympathy', 'tact', 'calibration', 'drama', 'economy', 'engineering', 'examination', 'philosophy', 'poetry', 'research', 'science', 'democracy', 'election', 'feminism', 'champagne', 'coffee', 'cookies', 'flowers', 'fragrance', 'honeydew', 'music', 'pizza', 'aurora', 'blizzard', 'current', 'dew', 'downpour', 'drizzle', 'hail', 'hurricane', 'lightning', 'rain', 'snow', 'storm', 'sunshine', 'tempest', 'thunder', 'tornado', 'typhoon', 'weather', 'wind', 'whirlwind', 'abracadabra', 'adventure', 'atheism', 'camouflage', 'destiny', 'endeavor', 'expression', 'fantasy', 'fertility', 'imagination', 'karma', 'masquerade', 'maturity', 'radiance', 'shopping', 'sorcery', 'unity', 'witchcraft', 'wizardry', 'wonder', 'youth', 'purring'], 'max_length': 13}, 'subj2': {'type': 'phrases', 'phrases': [('atlantic', 'puffin'), ('bank', 'swallow'), ('barn', 'owl'), ('barn', 'swallow'), ('barred', 'owl'), ('chimney', 'swift'), ('cliff', 'swallow'), ('emperor', 'goose'), ('harlequin', 'duck'), ('himalayan', 'snowcock'), ('hyacinth', 'macaw'), ('mangrove', 'cuckoo'), ('mute', 'swan'), ('northern', 'cardinal'), ('peregrine', 'falcon'), ('prairie', 'falcon'), ('red', 'cardinal'), ('snow', 'goose'), ('snowy', 'owl'), ('trumpeter', 'swan'), ('tufted', 'puffin'), ('whooper', 'swan'), ('whooping', 'crane'), ('fire', 'ant'), ('alpine', 'chipmunk'), ('beaked', 'whale'), ('bottlenose', 'dolphin'), ('clouded', 'leopard'), ('eared', 'seal'), ('elephant', 'seal'), ('feral', 'cat'), ('feral', 'dog'), ('feral', 'donkey'), ('feral', 'goat'), ('feral', 'horse'), ('feral', 'pig'), ('fur', 'seal'), ('grizzly', 'bear'), ('harbor', 'porpoise'), ('honey', 'badger'), ('humpback', 'whale'), ('killer', 'whale'), ('mountain', 'deer'), ('mountain', 'goat'), ('mountain', 'lion'), ('olympic', 'marmot'), ('pampas', 'deer'), ('pine', 'marten'), ('polynesian', 'rat'), ('rhesus', 'macaque'), ('river', 'dolphin'), ('sea', 'lion'), ('sea', 'otter'), ('snow', 'leopard'), ('sperm', 'whale'), ('spinner', 'dolphin'), ('vampire', 'bat'), ('gila', 'monster'), ('freshwater', 'crocodile'), ('saltwater', 'crocodile'), ('snapping', 'turtle'), ('walking', 'mushroom')], 'number_of_words': 2, 'max_length': 22}, 'adjective': {'type': 'words', 'words': ['acrid', 'ambrosial', 'amorphous', 'armored', 'aromatic', 'bald', 'blazing', 'boisterous', 'bouncy', 'brawny', 'bulky', 'camouflaged', 'caped', 'chubby', 'curvy', 'elastic', 'ethereal', 'fat', 'feathered', 'fiery', 'flashy', 'flat', 'fluffy', 'foamy', 'fragrant', 'furry', 'fuzzy', 'glaring', 'hairy', 'heavy', 'hissing', 'horned', 'icy', 'imaginary', 'invisible', 'lean', 'loud', 'loutish', 'lumpy', 'lush', 'masked', 'meaty', 'messy', 'misty', 'nebulous', 'noisy', 'nondescript', 'organic', 'purring', 'quiet', 'quirky', 'radiant', 'roaring', 'ruddy', 'rustling', 'screeching', 'shaggy', 'shapeless', 'shiny', 'silent', 'silky', 'singing', 'skinny', 'smooth', 'soft', 'spicy', 'spiked', 'statuesque', 'sticky', 'tacky', 'tall', 'tangible', 'tentacled', 'thick', 'thundering', 'venomous', 'warm', 'weightless', 'whispering', 'winged', 'wooden', 'adorable', 'affable', 'amazing', 'amiable', 'attractive', 'beautiful', 'calm', 'charming', 'cherubic', 'classic', 'classy', 'convivial', 'cordial', 'cuddly', 'curly', 'cute', 'debonair', 'elegant', 'famous', 'fresh', 'friendly', 'funny', 'gorgeous', 'graceful', 'gregarious', 'grinning', 'handsome', 'hilarious', 'hot', 'interesting', 'kind', 'laughing', 'lovely', 'meek', 'mellow', 'merciful', 'neat', 'nifty', 'notorious', 'poetic', 'pretty', 'refined', 'refreshing', 'sexy', 'smiling', 'sociable', 'spiffy', 'stylish', 'sweet', 'tactful', 'whimsical', 'abiding', 'accurate', 'adamant', 'adaptable', 'adventurous', 'alluring', 'aloof', 'ambitious', 'amusing', 'annoying', 'arrogant', 'aspiring', 'belligerent', 'benign', 'berserk', 'benevolent', 'bold', 'brave', 'cheerful', 'chirpy', 'cocky', 'congenial', 'courageous', 'cryptic', 'curious', 'daft', 'dainty', 'daring', 'defiant', 'delicate', 'delightful', 'determined', 'devout', 'didactic', 'diligent', 'discreet', 'dramatic', 'dynamic', 'eager', 'eccentric', 'elated', 'encouraging', 'enigmatic', 'enthusiastic', 'evasive', 'faithful', 'fair', 'fanatic', 'fearless', 'fervent', 'festive', 'fierce', 'fine', 'free', 'gabby', 'garrulous', 'gay', 'gentle', 'glistening', 'greedy', 'grumpy', 'happy', 'honest', 'hopeful', 'hospitable', 'impetuous', 'independent', 'industrious', 'innocent', 'intrepid', 'jolly', 'jovial', 'just', 'lively', 'loose', 'loyal', 'merry', 'modest', 'mysterious', 'nice', 'obedient', 'optimistic', 'orthodox', 'outgoing', 'outrageous', 'overjoyed', 'passionate', 'perky', 'placid', 'polite', 'positive', 'proud', 'prudent', 'puzzling', 'quixotic', 'quizzical', 'rebel', 'resolute', 'rampant', 'righteous', 'romantic', 'rough', 'rousing', 'sassy', 'satisfied', 'sly', 'sincere', 'snobbish', 'spirited', 'spry', 'stalwart', 'stirring', 'swinging', 'tasteful', 'thankful', 'tidy', 'tremendous', 'truthful', 'unselfish', 'upbeat', 'uppish', 'valiant', 'vehement', 'vengeful', 'vigorous', 'vivacious', 'zealous', 'zippy', 'able', 'adept', 'analytic', 'astute', 'attentive', 'brainy', 'busy', 'calculating', 'capable', 'careful', 'cautious', 'certain', 'clever', 'competent', 'conscious', 'cooperative', 'crafty', 'crazy', 'cunning', 'daffy', 'devious', 'discerning', 'efficient', 'expert', 'functional', 'gifted', 'helpful', 'enlightened', 'idealistic', 'impartial', 'industrious', 'ingenious', 'inquisitive', 'intelligent', 'inventive', 'judicious', 'keen', 'knowing', 'literate', 'logical', 'masterful', 'mindful', 'nonchalant', 'observant', 'omniscient', 'poised', 'practical', 'pragmatic', 'proficient', 'provocative', 'qualified', 'radical', 'rational', 'realistic', 'resourceful', 'savvy', 'sceptical', 'sensible', 'serious', 'shrewd', 'skilled', 'slick', 'slim', 'sloppy', 'smart', 'sophisticated', 'stoic', 'succinct', 'talented', 'thoughtful', 'tricky', 'unbiased', 'uptight', 'versatile', 'versed', 'visionary', 'wise', 'witty', 'accelerated', 'active', 'agile', 'athletic', 'dashing', 'deft', 'dexterous', 'energetic', 'fast', 'frisky', 'hasty', 'hypersonic', 'meteoric', 'mighty', 'muscular', 'nimble', 'nippy', 'powerful', 'prompt', 'quick', 'rapid', 'resilient', 'robust', 'rugged', 'solid', 'speedy', 'steadfast', 'steady', 'strong', 'sturdy', 'tireless', 'tough', 'unyielding', 'rich', 'wealthy', 'meticulous', 'precise', 'rigorous', 'scrupulous', 'strict', 'airborne', 'burrowing', 'crouching', 'flying', 'hidden', 'hopping', 'jumping', 'lurking', 'tunneling', 'warping', 'aboriginal', 'amphibian', 'aquatic', 'arboreal', 'polar', 'terrestrial', 'urban', 'accomplished', 'astonishing', 'authentic', 'awesome', 'delectable', 'excellent', 'exotic', 'exuberant', 'fabulous', 'fantastic', 'fascinating', 'flawless', 'fortunate', 'funky', 'godlike', 'glorious', 'groovy', 'honored', 'illustrious', 'imposing', 'important', 'impressive', 'incredible', 'invaluable', 'kickass', 'majestic', 'magnificent', 'marvellous', 'monumental', 'perfect', 'phenomenal', 'pompous', 'precious', 'premium', 'private', 'remarkable', 'spectacular', 'splendid', 'successful', 'wonderful', 'wondrous', 'offbeat', 'original', 'outstanding', 'quaint', 'unique', 'ancient', 'antique', 'prehistoric', 'primitive', 'abstract', 'acoustic', 'angelic', 'arcane', 'archetypal', 'augmented', 'auspicious', 'axiomatic', 'beneficial', 'bipedal', 'bizarre', 'complex', 'dancing', 'dangerous', 'demonic', 'divergent', 'economic', 'electric', 'elite', 'eminent', 'enchanted', 'esoteric', 'finicky', 'fractal', 'futuristic', 'gainful', 'hallowed', 'heavenly', 'heretic', 'holistic', 'hungry', 'hypnotic', 'hysterical', 'illegal', 'imperial', 'imported', 'impossible', 'inescapable', 'juicy', 'liberal', 'ludicrous', 'lyrical', 'magnetic', 'manipulative', 'mature', 'military', 'macho', 'married', 'melodic', 'natural', 'naughty', 'nocturnal', 'nostalgic', 'optimal', 'pastoral', 'peculiar', 'piquant', 'pristine', 'prophetic', 'psychedelic', 'quantum', 'rare', 'real', 'secret', 'simple', 'spectral', 'spiritual', 'stereotyped', 'stimulating', 'straight', 'strange', 'tested', 'therapeutic', 'true', 'ubiquitous', 'uncovered', 'unnatural', 'utopian', 'vagabond', 'vague', 'vegan', 'victorious', 'vigilant', 'voracious', 'wakeful', 'wandering', 'watchful', 'wild', 'bright', 'brilliant', 'colorful', 'crystal', 'dark', 'dazzling', 'fluorescent', 'glittering', 'glossy', 'gleaming', 'light', 'mottled', 'neon', 'opalescent', 'pastel', 'smoky', 'sparkling', 'spotted', 'striped', 'translucent', 'transparent', 'vivid'], 'max_length': 13}, 'animal': {'type': 'words', 'words': ['earthworm', 'leech', 'worm', 'scorpion', 'spider', 'tarantula', 'barnacle', 'crab', 'crayfish', 'lobster', 'pillbug', 'prawn', 'shrimp', 'ant', 'bee', 'beetle', 'bug', 'bumblebee', 'butterfly', 'caterpillar', 'cicada', 'cricket', 'dragonfly', 'earwig', 'firefly', 'grasshopper', 'honeybee', 'hornet', 'inchworm', 'ladybug', 'locust', 'mantis', 'mayfly', 'mosquito', 'moth', 'sawfly', 'silkworm', 'termite', 'wasp', 'woodlouse', 'centipede', 'millipede', 'pronghorn', 'antelope', 'bison', 'buffalo', 'bull', 'chamois', 'cow', 'gazelle', 'gaur', 'goat', 'ibex', 'impala', 'kudu', 'markhor', 'mouflon', 'muskox', 'nyala', 'sheep', 'wildebeest', 'yak', 'zebu', 'alpaca', 'camel', 'llama', 'vicugna', 'caribou', 'chital', 'deer', 'elk', 'moose', 'pudu', 'reindeer', 'sambar', 'wapiti', 'beluga', 'dolphin', 'narwhal', 'orca', 'porpoise', 'whale', 'donkey', 'horse', 'stallion', 'zebra', 'giraffe', 'okapi', 'hippo', 'rhino', 'boar', 'hog', 'pig', 'swine', 'warthog', 'peccary', 'buzzard', 'eagle', 'goshawk', 'harrier', 'hawk', 'vulture', 'duck', 'goose', 'swan', 'teal', 'bird', 'hummingbird', 'swift', 'kiwi', 'potoo', 'seriema', 'cassowary', 'emu', 'condor', 'auk', 'avocet', 'guillemot', 'kittiwake', 'puffin', 'seagull', 'skua', 'stork', 'dodo', 'dove', 'pigeon', 'kingfisher', 'tody', 'bustard', 'coua', 'coucal', 'cuckoo', 'koel', 'malkoha', 'roadrunner', 'kagu', 'caracara', 'falcon', 'kestrel', 'chachalaca', 'chicken', 'curassow', 'grouse', 'guan', 'junglefowl', 'partridge', 'peacock', 'pheasant', 'quail', 'rooster', 'turkey', 'loon', 'coot', 'crane', 'turaco', 'hoatzin', 'bullfinch', 'crow', 'jackdaw', 'jaybird', 'finch', 'lyrebird', 'magpie', 'myna', 'nightingale', 'nuthatch', 'oriole', 'oxpecker', 'raven', 'robin', 'rook', 'skylark', 'sparrow', 'starling', 'swallow', 'waxbill', 'wren', 'heron', 'ibis', 'jacamar', 'piculet', 'toucan', 'toucanet', 'woodpecker', 'flamingo', 'grebe', 'albatross', 'fulmar', 'petrel', 'spoonbill', 'ara', 'cockatoo', 'kakapo', 'lorikeet', 'macaw', 'parakeet', 'parrot', 'penguin', 'ostrich', 'boobook', 'owl', 'booby', 'cormorant', 'frigatebird', 'pelican', 'quetzal', 'trogon', 'axolotl', 'bullfrog', 'frog', 'newt', 'salamander', 'toad', 'angelfish', 'barracuda', 'carp', 'catfish', 'dogfish', 'goldfish', 'guppy', 'eel', 'flounder', 'herring', 'lionfish', 'mackerel', 'oarfish', 'perch', 'salmon', 'seahorse', 'sturgeon', 'sunfish', 'tench', 'trout', 'tuna', 'wrasse', 'sawfish', 'shark', 'stingray', 'jellyfish', 'alligator', 'caiman', 'crocodile', 'gharial', 'starfish', 'urchin', 'hedgehog', 'coyote', 'dingo', 'dog', 'fennec', 'fox', 'hound', 'jackal', 'tanuki', 'wolf', 'bobcat', 'caracal', 'cat', 'cougar', 'jaguar', 'jaguarundi', 'leopard', 'lion', 'lynx', 'manul', 'ocelot', 'panther', 'puma', 'serval', 'smilodon', 'tiger', 'wildcat', 'aardwolf', 'binturong', 'cheetah', 'civet', 'fossa', 'hyena', 'meerkat', 'mongoose', 'badger', 'coati', 'ermine', 'ferret', 'marten', 'mink', 'otter', 'polecat', 'skunk', 'stoat', 'weasel', 'wolverine', 'seal', 'walrus', 'raccoon', 'ringtail', 'bear', 'panda', 'bat', 'armadillo', 'elephant', 'mammoth', 'mastodon', 'mole', 'hyrax', 'bandicoot', 'bettong', 'cuscus', 'kangaroo', 'koala', 'numbat', 'quokka', 'quoll', 'wallaby', 'wombat', 'echidna', 'platypus', 'tapir', 'anteater', 'sloth', 'agouti', 'beaver', 'capybara', 'chinchilla', 'chipmunk', 'degu', 'dormouse', 'gerbil', 'gopher', 'groundhog', 'jackrabbit', 'jerboa', 'hamster', 'hare', 'lemming', 'marmot', 'mouse', 'muskrat', 'porcupine', 'rabbit', 'rat', 'squirrel', 'vole', 'ape', 'baboon', 'bonobo', 'capuchin', 'chimpanzee', 'galago', 'gibbon', 'gorilla', 'lemur', 'lori', 'macaque', 'mandrill', 'marmoset', 'monkey', 'orangutan', 'tamarin', 'tarsier', 'uakari', 'dugong', 'manatee', 'shrew', 'aardwark', 'clam', 'cockle', 'mussel', 'oyster', 'scallop', 'shellfish', 'ammonite', 'cuttlefish', 'nautilus', 'octopus', 'squid', 'limpet', 'slug', 'snail', 'sponge', 'tuatara', 'agama', 'chameleon', 'dragon', 'gecko', 'iguana', 'lizard', 'pogona', 'skink', 'adder', 'anaconda', 'asp', 'boa', 'cobra', 'copperhead', 'mamba', 'python', 'rattlesnake', 'sidewinder', 'snake', 'taipan', 'viper', 'tortoise', 'turtle', 'dinosaur', 'raptor', 'mushroom'], 'max_length': 13}, 'color': {'type': 'words', 'words': ['almond', 'amaranth', 'apricot', 'artichoke', 'auburn', 'azure', 'banana', 'beige', 'black', 'blond', 'blue', 'brown', 'burgundy', 'carmine', 'carrot', 'celadon', 'cerise', 'cerulean', 'charcoal', 'cherry', 'chestnut', 'chocolate', 'cinnamon', 'copper', 'cream', 'crimson', 'cyan', 'daffodil', 'dandelion', 'denim', 'ebony', 'eggplant', 'gray', 'ginger', 'green', 'indigo', 'infrared', 'jasmine', 'khaki', 'lavender', 'lilac', 'mauve', 'magenta', 'mahogany', 'maize', 'marigold', 'mustard', 'ochre', 'orange', 'papaya', 'peach', 'persimmon', 'pink', 'pistachio', 'pumpkin', 'purple', 'raspberry', 'red', 'rose', 'russet', 'saffron', 'sage', 'scarlet', 'sepia', 'silver', 'tan', 'tangerine', 'taupe', 'teal', 'tomato', 'turquoise', 'tuscan', 'ultramarine', 'ultraviolet', 'umber', 'vanilla', 'vermilion', 'violet', 'viridian', 'white', 'wine', 'wisteria', 'yellow', 'agate', 'amber', 'amethyst', 'aquamarine', 'asparagus', 'beryl', 'brass', 'bronze', 'cobalt', 'coral', 'cornflower', 'diamond', 'emerald', 'garnet', 'golden', 'granite', 'ivory', 'jade', 'jasper', 'lemon', 'lime', 'malachite', 'maroon', 'myrtle', 'nickel', 'olive', 'olivine', 'onyx', 'opal', 'orchid', 'pearl', 'peridot', 'platinum', 'quartz', 'ruby', 'sandy', 'sapphire', 'steel', 'thistle', 'topaz', 'tourmaline', 'tungsten', 'xanthic', 'zircon'], 'max_length': 13}, 'noun_adjective': {'type': 'words', 'words': ['fancy', 'magic', 'rainbow', 'woodoo'], 'max_length': 13}, 'animal_legendary': {'type': 'words', 'words': ['basilisk', 'chupacabra', 'dragon', 'griffin', 'pegasus', 'unicorn'], 'max_length': 13}, 'adjective_first': {'type': 'words', 'words': ['first', 'new'], 'max_length': 13}} try: for listdef in config.values(): if listdef['type'] == 'words': listdef['words'] = [unicode(x) for x in listdef['words']] elif listdef['type'] == 'phrases': listdef['phrases'] = [tuple((unicode(y) for y in x)) for x in listdef['phrases']] elif listdef['type'] == 'const': listdef['value'] = unicode(listdef['value']) except NameError: pass
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. XML_ENTRY_1 = """<?xml version='1.0'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:g='http://base.google.com/ns/1.0'> <category scheme="http://base.google.com/categories/itemtypes" term="products"/> <id> http://www.google.com/test/id/url </id> <title type='text'>Testing 2000 series laptop</title> <content type='xhtml'> <div xmlns='http://www.w3.org/1999/xhtml'>A Testing Laptop</div> </content> <link rel='alternate' type='text/html' href='http://www.provider-host.com/123456789'/> <link rel='license' href='http://creativecommons.org/licenses/by-nc/2.5/rdf'/> <g:label>Computer</g:label> <g:label>Laptop</g:label> <g:label>testing laptop</g:label> <g:item_type>products</g:item_type> </entry>""" TEST_BASE_ENTRY = """<?xml version='1.0'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:g='http://base.google.com/ns/1.0'> <category scheme="http://base.google.com/categories/itemtypes" term="products"/> <title type='text'>Testing 2000 series laptop</title> <content type='xhtml'> <div xmlns='http://www.w3.org/1999/xhtml'>A Testing Laptop</div> </content> <app:control xmlns:app='http://purl.org/atom/app#'> <app:draft>yes</app:draft> <gm:disapproved xmlns:gm='http://base.google.com/ns-metadata/1.0'/> </app:control> <link rel='alternate' type='text/html' href='http://www.provider-host.com/123456789'/> <g:label>Computer</g:label> <g:label>Laptop</g:label> <g:label>testing laptop</g:label> <g:item_type>products</g:item_type> </entry>""" BIG_FEED = """<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title type="text">dive into mark</title> <subtitle type="html"> A &lt;em&gt;lot&lt;/em&gt; of effort went into making this effortless </subtitle> <updated>2005-07-31T12:29:29Z</updated> <id>tag:example.org,2003:3</id> <link rel="alternate" type="text/html" hreflang="en" href="http://example.org/"/> <link rel="self" type="application/atom+xml" href="http://example.org/feed.atom"/> <rights>Copyright (c) 2003, Mark Pilgrim</rights> <generator uri="http://www.example.com/" version="1.0"> Example Toolkit </generator> <entry> <title>Atom draft-07 snapshot</title> <link rel="alternate" type="text/html" href="http://example.org/2005/04/02/atom"/> <link rel="enclosure" type="audio/mpeg" length="1337" href="http://example.org/audio/ph34r_my_podcast.mp3"/> <id>tag:example.org,2003:3.2397</id> <updated>2005-07-31T12:29:29Z</updated> <published>2003-12-13T08:29:29-04:00</published> <author> <name>Mark Pilgrim</name> <uri>http://example.org/</uri> <email>f8dy@example.com</email> </author> <contributor> <name>Sam Ruby</name> </contributor> <contributor> <name>Joe Gregorio</name> </contributor> <content type="xhtml" xml:lang="en" xml:base="http://diveintomark.org/"> <div xmlns="http://www.w3.org/1999/xhtml"> <p><i>[Update: The Atom draft is finished.]</i></p> </div> </content> </entry> </feed> """ SMALL_FEED = """<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Example Feed</title> <link href="http://example.org/"/> <updated>2003-12-13T18:30:02Z</updated> <author> <name>John Doe</name> </author> <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> <entry> <title>Atom-Powered Robots Run Amok</title> <link href="http://example.org/2003/12/13/atom03"/> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2003-12-13T18:30:02Z</updated> <summary>Some text.</summary> </entry> </feed> """ GBASE_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:g='http://base.google.com/ns/1.0' xmlns:batch='http://schemas.google.com/gdata/batch'> <id>http://www.google.com/base/feeds/snippets</id> <updated>2007-02-08T23:18:21.935Z</updated> <title type='text'>Items matching query: digital camera</title> <link rel='alternate' type='text/html' href='http://base.google.com'> </link> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets?start-index=1&amp;max-results=25&amp;bq=digital+camera'> </link> <link rel='next' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets?start-index=26&amp;max-results=25&amp;bq=digital+camera'> </link> <generator version='1.0' uri='http://base.google.com'>GoogleBase </generator> <openSearch:totalResults>2171885</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://www.google.com/base/feeds/snippets/13246453826751927533</id> <published>2007-02-08T13:23:27.000Z</published> <updated>2007-02-08T16:40:57.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'> </category> <title type='text'>Digital Camera Battery Notebook Computer 12v DC Power Cable - 5.5mm x 2.5mm (Center +) Camera Connecting Cables</title> <content type='html'>Notebook Computer 12v DC Power Cable - 5.5mm x 2.1mm (Center +) This connection cable will allow any Digital Pursuits battery pack to power portable computers that operate with 12v power and have a 2.1mm power connector (center +) Digital ...</content> <link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305668&amp;is=REG&amp;kw=DIDCB5092&amp;BI=583'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/13246453826751927533'> </link> <author> <name>B&amp;H Photo-Video</name> <email>anon-szot0wdsq0at@base.google.com</email> </author> <g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes> <g:condition type='text'>new</g:condition> <g:location type='location'>420 9th Ave. 10001</g:location> <g:id type='text'>305668-REG</g:id> <g:item_type type='text'>Products</g:item_type> <g:brand type='text'>Digital Camera Battery</g:brand> <g:expiration_date type='dateTime'>2007-03-10T13:23:27.000Z</g:expiration_date> <g:customer_id type='int'>1172711</g:customer_id> <g:price type='floatUnit'>34.95 usd</g:price> <g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type> <g:item_language type='text'>EN</g:item_language> <g:manufacturer_id type='text'>DCB5092</g:manufacturer_id> <g:target_country type='text'>US</g:target_country> <g:weight type='float'>1.0</g:weight> <g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305668.jpg&amp;dhm=ffffffff84c9a95e&amp;size=6</g:image_link> </entry> <entry> <id>http://www.google.com/base/feeds/snippets/10145771037331858608</id> <published>2007-02-08T13:23:27.000Z</published> <updated>2007-02-08T16:40:57.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'> </category> <title type='text'>Digital Camera Battery Electronic Device 5v DC Power Cable - 5.5mm x 2.5mm (Center +) Camera Connecting Cables</title> <content type='html'>Electronic Device 5v DC Power Cable - 5.5mm x 2.5mm (Center +) This connection cable will allow any Digital Pursuits battery pack to power any electronic device that operates with 5v power and has a 2.5mm power connector (center +) Digital ...</content> <link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305656&amp;is=REG&amp;kw=DIDCB5108&amp;BI=583'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/10145771037331858608'> </link> <author> <name>B&amp;H Photo-Video</name> <email>anon-szot0wdsq0at@base.google.com</email> </author> <g:location type='location'>420 9th Ave. 10001</g:location> <g:condition type='text'>new</g:condition> <g:weight type='float'>0.18</g:weight> <g:target_country type='text'>US</g:target_country> <g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type> <g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes> <g:id type='text'>305656-REG</g:id> <g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305656.jpg&amp;dhm=7315bdc8&amp;size=6</g:image_link> <g:manufacturer_id type='text'>DCB5108</g:manufacturer_id> <g:upc type='text'>838098005108</g:upc> <g:price type='floatUnit'>34.95 usd</g:price> <g:item_language type='text'>EN</g:item_language> <g:brand type='text'>Digital Camera Battery</g:brand> <g:customer_id type='int'>1172711</g:customer_id> <g:item_type type='text'>Products</g:item_type> <g:expiration_date type='dateTime'>2007-03-10T13:23:27.000Z</g:expiration_date> </entry> <entry> <id>http://www.google.com/base/feeds/snippets/3128608193804768644</id> <published>2007-02-08T02:21:27.000Z</published> <updated>2007-02-08T15:40:13.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'> </category> <title type='text'>Digital Camera Battery Power Cable for Kodak 645 Pro-Back ProBack &amp; DCS-300 Series Camera Connecting Cables</title> <content type='html'>Camera Connection Cable - to Power Kodak 645 Pro-Back DCS-300 Series Digital Cameras This connection cable will allow any Digital Pursuits battery pack to power the following digital cameras: Kodak DCS Pro Back 645 DCS-300 series Digital Photography ...</content> <link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305685&amp;is=REG&amp;kw=DIDCB6006&amp;BI=583'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/3128608193804768644'> </link> <author> <name>B&amp;H Photo-Video</name> <email>anon-szot0wdsq0at@base.google.com</email> </author> <g:weight type='float'>0.3</g:weight> <g:manufacturer_id type='text'>DCB6006</g:manufacturer_id> <g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305685.jpg&amp;dhm=72f0ca0a&amp;size=6</g:image_link> <g:location type='location'>420 9th Ave. 10001</g:location> <g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes> <g:item_type type='text'>Products</g:item_type> <g:target_country type='text'>US</g:target_country> <g:accessory_for type='text'>digital kodak camera</g:accessory_for> <g:brand type='text'>Digital Camera Battery</g:brand> <g:expiration_date type='dateTime'>2007-03-10T02:21:27.000Z</g:expiration_date> <g:item_language type='text'>EN</g:item_language> <g:condition type='text'>new</g:condition> <g:price type='floatUnit'>34.95 usd</g:price> <g:customer_id type='int'>1172711</g:customer_id> <g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type> <g:id type='text'>305685-REG</g:id> </entry> </feed>""" EXTENSION_TREE = """<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <g:author xmlns:g="http://www.google.com"> <g:name>John Doe <g:foo yes="no" up="down">Bar</g:foo> </g:name> </g:author> </feed> """ TEST_AUTHOR = """<?xml version="1.0" encoding="utf-8"?> <author xmlns="http://www.w3.org/2005/Atom"> <name xmlns="http://www.w3.org/2005/Atom">John Doe</name> <email xmlns="http://www.w3.org/2005/Atom">johndoes@someemailadress.com</email> <uri xmlns="http://www.w3.org/2005/Atom">http://www.google.com</uri> </author> """ TEST_LINK = """<?xml version="1.0" encoding="utf-8"?> <link xmlns="http://www.w3.org/2005/Atom" href="http://www.google.com" rel="test rel" foo1="bar" foo2="rab"/> """ TEST_GBASE_ATTRIBUTE = """<?xml version="1.0" encoding="utf-8"?> <g:brand type='text' xmlns:g="http://base.google.com/ns/1.0">Digital Camera Battery</g:brand> """ CALENDAR_FEED = """<?xml version='1.0' encoding='utf-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gCal='http://schemas.google.com/gCal/2005'> <id>http://www.google.com/calendar/feeds/default</id> <updated>2007-03-20T22:48:57.833Z</updated> <title type='text'>GData Ops Demo's Calendar List</title> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default'></link> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default'></link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <generator version='1.0' uri='http://www.google.com/calendar'> Google Calendar</generator> <openSearch:startIndex>1</openSearch:startIndex> <entry> <id> http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com</id> <published>2007-03-20T22:48:57.837Z</published> <updated>2007-03-20T22:48:52.000Z</updated> <title type='text'>GData Ops Demo</title> <link rel='alternate' type='application/atom+xml' href='http://www.google.com/calendar/feeds/gdata.ops.demo%40gmail.com/private/full'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:color value='#2952A3'></gCal:color> <gCal:accesslevel value='owner'></gCal:accesslevel> <gCal:hidden value='false'></gCal:hidden> <gCal:timezone value='America/Los_Angeles'></gCal:timezone> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com</id> <published>2007-03-20T22:48:57.837Z</published> <updated>2007-03-20T22:48:53.000Z</updated> <title type='text'>GData Ops Demo Secondary Calendar</title> <summary type='text'></summary> <link rel='alternate' type='application/atom+xml' href='http://www.google.com/calendar/feeds/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com/private/full'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com'> </link> <author> <name>GData Ops Demo Secondary Calendar</name> </author> <gCal:color value='#528800'></gCal:color> <gCal:accesslevel value='owner'></gCal:accesslevel> <gCal:hidden value='false'></gCal:hidden> <gCal:timezone value='America/Los_Angeles'></gCal:timezone> <gd:where valueString=''></gd:where> </entry> </feed> """ CALENDAR_FULL_EVENT_FEED = """<?xml version='1.0' encoding='utf-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gCal='http://schemas.google.com/gCal/2005'> <id> http://www.google.com/calendar/feeds/default/private/full</id> <updated>2007-03-20T21:29:57.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>GData Ops Demo</title> <subtitle type='text'>GData Ops Demo</subtitle> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full'> </link> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full?updated-min=2001-01-01&amp;max-results=25'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <generator version='1.0' uri='http://www.google.com/calendar'> Google Calendar</generator> <openSearch:totalResults>10</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <gCal:timezone value='America/Los_Angeles'></gCal:timezone> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100</id> <published>2007-03-20T21:29:52.000Z</published> <updated>2007-03-20T21:29:57.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>test deleted</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=bzk5ZmxtZ21rZmtmcnI4dTc0NWdocjMxMDAgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/63310109397'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.canceled'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-23T12:00:00.000-07:00' endTime='2007-03-23T13:00:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0</id> <published>2007-03-20T21:26:04.000Z</published> <updated>2007-03-20T21:28:46.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Afternoon at Dolores Park with Kim</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=MnF0M2FvNWhiYXE3bTlpZ3I1YWs5ZXNqbzAgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/63310109326'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.private'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:who rel='http://schemas.google.com/g/2005#event.organizer' valueString='GData Ops Demo' email='gdata.ops.demo@gmail.com'> <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'> </gd:attendeeStatus> </gd:who> <gd:who rel='http://schemas.google.com/g/2005#event.attendee' valueString='Ryan Boyd (API)' email='api.rboyd@gmail.com'> <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'> </gd:attendeeStatus> </gd:who> <gd:when startTime='2007-03-24T12:00:00.000-07:00' endTime='2007-03-24T15:00:00.000-07:00'> <gd:reminder minutes='20'></gd:reminder> </gd:when> <gd:where valueString='Dolores Park with Kim'></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos</id> <published>2007-03-20T21:28:37.000Z</published> <updated>2007-03-20T21:28:37.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Team meeting</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=dXZzcWhnN2tsbmFlNDB2NTB2aWhyMXB2b3NfMjAwNzAzMjNUMTYwMDAwWiBnZGF0YS5vcHMuZGVtb0Bt' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos/63310109317'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gd:recurrence>DTSTART;TZID=America/Los_Angeles:20070323T090000 DTEND;TZID=America/Los_Angeles:20070323T100000 RRULE:FREQ=WEEKLY;BYDAY=FR;UNTIL=20070817T160000Z;WKST=SU BEGIN:VTIMEZONE TZID:America/Los_Angeles X-LIC-LOCATION:America/Los_Angeles BEGIN:STANDARD TZOFFSETFROM:-0700 TZOFFSETTO:-0800 TZNAME:PST DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0800 TZOFFSETTO:-0700 TZNAME:PDT DTSTART:19700405T020000 RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT END:VTIMEZONE</gd:recurrence> <gCal:sendEventNotifications value='true'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:visibility value='http://schemas.google.com/g/2005#event.public'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:reminder minutes='10'></gd:reminder> <gd:where valueString=''></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo</id> <published>2007-03-20T21:25:46.000Z</published> <updated>2007-03-20T21:25:46.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Movie with Kim and danah</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=c3Q0dms5a2lmZnM2cmFzcmwzMmU0YTdhbG8gZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/63310109146'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-24T20:00:00.000-07:00' endTime='2007-03-24T21:00:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo</id> <published>2007-03-20T21:24:43.000Z</published> <updated>2007-03-20T21:25:08.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Dinner with Kim and Sarah</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=b2ZsMWU0NXVidHNvaDZndHUxMjdjbHMyb28gZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/63310109108'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-20T19:00:00.000-07:00' endTime='2007-03-20T21:30:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g</id> <published>2007-03-20T21:24:19.000Z</published> <updated>2007-03-20T21:25:05.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Dinner with Jane and John</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=YjY5czJhdmZpMmpvaWdzY2xlY3ZqbGM5MWcgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/63310109105'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-22T17:00:00.000-07:00' endTime='2007-03-22T19:30:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc</id> <published>2007-03-20T21:24:33.000Z</published> <updated>2007-03-20T21:24:33.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Tennis with Elizabeth</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=dTlwNjZra2lvdG44YnFoOWs3ajRyY25qamMgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/63310109073'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-24T10:00:00.000-07:00' endTime='2007-03-24T11:00:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c</id> <published>2007-03-20T21:24:00.000Z</published> <updated>2007-03-20T21:24:00.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Lunch with Jenn</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=NzZvajJrY2VpZG9iM3M3MDh0dmZudWFxM2MgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/63310109040'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-03-20T11:30:00.000-07:00' endTime='2007-03-20T12:30:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco</id> <published>2007-03-20T07:50:02.000Z</published> <updated>2007-03-20T20:39:26.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>test entry</title> <content type='text'>test desc</content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=NW5wOWVjOG03dW9hdWsxdmVkaDVtaG9kY28gZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/63310106366'> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.private'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:who rel='http://schemas.google.com/g/2005#event.attendee' valueString='Vivian Li' email='vli@google.com'> <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.declined'> </gd:attendeeStatus> </gd:who> <gd:who rel='http://schemas.google.com/g/2005#event.organizer' valueString='GData Ops Demo' email='gdata.ops.demo@gmail.com'> <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'> </gd:attendeeStatus> </gd:who> <gd:when startTime='2007-03-21T08:00:00.000-07:00' endTime='2007-03-21T09:00:00.000-07:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where valueString='anywhere'></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg</id> <published>2007-02-14T23:23:37.000Z</published> <updated>2007-02-14T23:25:30.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>test</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=ZnU2c2wwcnFha2YzbzBhMTNvbzFpMWExbWcgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/63307178730'> </link> <link rel="http://schemas.google.com/gCal/2005/webContent" title="World Cup" href="http://www.google.com/calendar/images/google-holiday.gif" type="image/gif"> <gCal:webContent width="276" height="120" url="http://www.google.com/logos/worldcup06.gif" /> </link> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/comments'> </gd:feedLink> </gd:comments> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:when startTime='2007-02-15T08:30:00.000-08:00' endTime='2007-02-15T09:30:00.000-08:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where></gd:where> </entry> <entry> <id> http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc</id> <published>2007-07-16T22:13:28.000Z</published> <updated>2007-07-16T22:13:29.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'></title> <content type='text' /> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=aDdhMGhhYTRkYThzaWwzcnIxOWlhNmx1dmMgZ2RhdGEub3BzLmRlbW9AbQ' title='alternate' /> <link rel='http://schemas.google.com/gCal/2005/webContent' type='application/x-google-gadgets+xml' href='http://gdata.ops.demo.googlepages.com/birthdayicon.gif' title='Date and Time Gadget'> <gCal:webContent width='300' height='136' url='http://google.com/ig/modules/datetime.xml'> <gCal:webContentGadgetPref name='color' value='green' /> </gCal:webContent> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc/63320307209' /> <author> <name>GData Ops Demo</name> <email>gdata.ops.demo@gmail.com</email> </author> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc/comments' /> </gd:comments> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed' /> <gd:visibility value='http://schemas.google.com/g/2005#event.default' /> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque' /> <gd:when startTime='2007-03-14' endTime='2007-03-15' /> <gd:where /> </entry> </feed> """ CALENDAR_BATCH_REQUEST = """<?xml version='1.0' encoding='utf-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gCal='http://schemas.google.com/gCal/2005'> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <entry> <batch:id>1</batch:id> <batch:operation type='insert' /> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event inserted via batch</title> </entry> <entry> <batch:id>2</batch:id> <batch:operation type='query' /> <id>http://www.google.com/calendar/feeds/default/private/full/glcs0kv2qqa0gf52qi1jo018gc</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event queried via batch</title> </entry> <entry> <batch:id>3</batch:id> <batch:operation type='update' /> <id>http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event updated via batch</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=dWptMGdvNWR0bmdka3I2dTkxZGNxdmowcXMgaGFyaXNodi50ZXN0QG0' title='alternate' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs/63326098791' /> </entry> <entry> <batch:id>4</batch:id> <batch:operation type='delete' /> <id>http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event deleted via batch</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=ZDhxYmc5ZWdrMW42bGhzZ3Exc2picWZmcWMgaGFyaXNodi50ZXN0QG0' title='alternate' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc/63326018324' /> </entry> </feed> """ CALENDAR_BATCH_RESPONSE = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gCal='http://schemas.google.com/gCal/2005'> <id>http://www.google.com/calendar/feeds/default/private/full</id> <updated>2007-09-21T23:01:00.380Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>Batch Feed</title> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full' /> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full' /> <link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/batch' /> <entry> <batch:id>1</batch:id> <batch:status code='201' reason='Created' /> <batch:operation type='insert' /> <id>http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event inserted via batch</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=bjl1Zzc4Z2Q5dHY1M3BwbjRoZGp2azY4ZWsgaGFyaXNodi50ZXN0QG0' title='alternate' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek/63326098860' /> </entry> <entry> <batch:id>2</batch:id> <batch:status code='200' reason='Success' /> <batch:operation type='query' /> <id>http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event queried via batch</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=Z2xzYzBrdjJhcWEwZmY1MnFpMWpvMDE4Z2MgaGFyaXNodi50ZXN0QG0' title='alternate' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc/63326098791' /> </entry> <entry xmlns:gCal='http://schemas.google.com/gCal/2005'> <batch:id>3</batch:id> <batch:status code='200' reason='Success' /> <batch:operation type='update' /> <id>http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event updated via batch</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=dWptMGdvNWR0bmdka3I2dTkxZGNxdmowcXMgaGFyaXNodi50ZXN0QG0' title='alternate' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs/63326098860' /> <batch:id>3</batch:id> <batch:status code='200' reason='Success' /> <batch:operation type='update' /> </entry> <entry> <batch:id>4</batch:id> <batch:status code='200' reason='Success' /> <batch:operation type='delete' /> <id>http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc</id> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' /> <title type='text'>Event deleted via batch</title> <content type='text'>Deleted</content> </entry> </feed> """ GBASE_ATTRIBUTE_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gm='http://base.google.com/ns-metadata/1.0'> <id>http://www.google.com/base/feeds/attributes</id> <updated>2006-11-01T20:35:59.578Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='online jobs'></category> <category scheme='http://base.google.com/categories/itemtypes' term='jobs'></category> <title type='text'>Attribute histogram for query: [item type:jobs]</title> <link rel='alternate' type='text/html' href='http://base.google.com'></link> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/base/feeds /attributes'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/attributes/-/jobs'></link> <generator version='1.0' uri='http://base.google.com'>GoogleBase</generator> <openSearch:totalResults>16</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>16</openSearch:itemsPerPage> <entry> <id>http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D</id> <updated>2006-11-01T20:36:00.100Z</updated> <title type='text'>job industry(text)</title> <content type='text'>Attribute"job industry" of type text. </content> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/attributes/job+industry%28text %29N%5Bitem+type%3Ajobs%5D'></link> <gm:attribute name='job industry' type='text' count='4416629'> <gm:value count='380772'>it internet</gm:value> <gm:value count='261565'>healthcare</gm:value> <gm:value count='142018'>information technology</gm:value> <gm:value count='124622'>accounting</gm:value> <gm:value count='111311'>clerical and administrative</gm:value> <gm:value count='82928'>other</gm:value> <gm:value count='77620'>sales and sales management</gm:value> <gm:value count='68764'>information systems</gm:value> <gm:value count='65859'>engineering and architecture</gm:value> <gm:value count='64757'>sales</gm:value> </gm:attribute> </entry> </feed> """ GBASE_ATTRIBUTE_ENTRY = """<?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gm='http://base.google.com/ns-metadata/1.0'> <id>http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D</id> <updated>2006-11-01T20:36:00.100Z</updated> <title type='text'>job industry(text)</title> <content type='text'>Attribute"job industry" of type text. </content> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D'></link> <gm:attribute name='job industry' type='text' count='4416629'> <gm:value count='380772'>it internet</gm:value> <gm:value count='261565'>healthcare</gm:value> <gm:value count='142018'>information technology</gm:value> <gm:value count='124622'>accounting</gm:value> <gm:value count='111311'>clerical and administrative</gm:value> <gm:value count='82928'>other</gm:value> <gm:value count='77620'>sales and sales management</gm:value> <gm:value count='68764'>information systems</gm:value> <gm:value count='65859'>engineering and architecture</gm:value> <gm:value count='64757'>sales</gm:value> </gm:attribute> </entry> """ GBASE_LOCALES_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gm='http://base.google.com/ns-metadata/1.0'> <id> http://www.google.com/base/feeds/locales/</id> <updated>2006-06-13T18:11:40.120Z</updated> <title type="text">Locales</title> <link rel="alternate" type="text/html" href="http://base.google.com"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/"/> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/"/> <author> <name>Google Inc.</name> <email>base@google.com</email> </author> <generator version="1.0" uri="http://base.google.com">GoogleBase</generator> <openSearch:totalResults>3</openSearch:totalResults> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://www.google.com/base/feeds/locales/en_US</id> <updated>2006-03-27T22:27:36.658Z</updated> <category scheme="http://base.google.com/categories/locales" term="en_US"/> <title type="text">en_US</title> <content type="text">en_US</content> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/en_US"></link> <link rel="related" type="application/atom+xml" href="http://www.google.com/base/feeds/itemtypes/en_US" title="Item types in en_US"/> </entry> <entry> <id>http://www.google.com/base/feeds/locales/en_GB</id> <updated>2006-06-13T18:14:18.601Z</updated> <category scheme="http://base.google.com/categories/locales" term="en_GB"/> <title type="text">en_GB</title> <content type="text">en_GB</content> <link rel="related" type="application/atom+xml" href="http://www.google.com/base/feeds/itemtypes/en_GB" title="Item types in en_GB"/> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/en_GB"/> </entry> <entry> <id>http://www.google.com/base/feeds/locales/de_DE</id> <updated>2006-06-13T18:14:18.601Z</updated> <category scheme="http://base.google.com/categories/locales" term="de_DE"/> <title type="text">de_DE</title> <content type="text">de_DE</content> <link rel="related" type="application/atom+xml" href="http://www.google.com/base/feeds/itemtypes/de_DE" title="Item types in de_DE"/> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/de_DE"/> </entry> </feed>""" GBASE_STRING_ENCODING_ENTRY = """<?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:gm='http://base.google.com/ns-metadata/1.0' xmlns:g='http://base.google.com/ns/1.0' xmlns:batch='http://schemas.google.com/gdata/batch'> <id>http://www.google.com/base/feeds/snippets/17495780256183230088</id> <published>2007-12-09T03:13:07.000Z</published> <updated>2008-01-07T03:26:46.000Z</updated> <category scheme='http://base.google.com/categories/itemtypes' term='Products'/> <title type='text'>Digital Camera Cord Fits SONY Cybershot DSC-R1 S40</title> <content type='html'>SONY \xC2\xB7 Cybershot Digital Camera Usb Cable DESCRIPTION This is a 2.5 USB 2.0 A to Mini B (5 Pin) high quality digital camera cable used for connecting your Sony Digital Cameras and Camcoders. Backward Compatible with USB 2.0, 1.0 and 1.1. Fully ...</content> <link rel='alternate' type='text/html' href='http://adfarm.mediaplex.com/ad/ck/711-5256-8196-2?loc=http%3A%2F%2Fcgi.ebay.com%2FDigital-Camera-Cord-Fits-SONY-Cybershot-DSC-R1-S40_W0QQitemZ270195049057QQcmdZViewItem'/> <link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/17495780256183230088'/> <author> <name>eBay</name> </author> <g:item_type type='text'>Products</g:item_type> <g:item_language type='text'>EN</g:item_language> <g:target_country type='text'>US</g:target_country> <g:price type='floatUnit'>0.99 usd</g:price> <g:image_link type='url'>http://thumbs.ebaystatic.com/pict/270195049057_1.jpg</g:image_link> <g:category type='text'>Cameras &amp; Photo&gt;Digital Camera Accessories&gt;Cables</g:category> <g:category type='text'>Cords &amp; Connectors&gt;USB Cables&gt;For Other Brands</g:category> <g:customer_id type='int'>11729</g:customer_id> <g:id type='text'>270195049057</g:id> <g:expiration_date type='dateTime'>2008-02-06T03:26:46Z</g:expiration_date> </entry>""" RECURRENCE_EXCEPTION_ENTRY = """<entry xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gCal='http://schemas.google.com/gCal/2005'> <id> http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g</id> <published>2007-04-05T21:51:49.000Z</published> <updated>2007-04-05T21:51:49.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>testDavid</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=aTdsZ2ZqNjltanFqZ25vZGtsaWYzdmJtN2dfMjAwNzA0MDNUMTgwMDAwWiBnZGF0YS5vcHMudGVzdEBt' title='alternate'></link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g'> </link> <author> <name>gdata ops</name> <email>gdata.ops.test@gmail.com</email> </author> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gCal:sendEventNotifications value='true'> </gCal:sendEventNotifications> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus> <gd:recurrence>DTSTART;TZID=America/Anchorage:20070403T100000 DTEND;TZID=America/Anchorage:20070403T110000 RRULE:FREQ=DAILY;UNTIL=20070408T180000Z;WKST=SU EXDATE;TZID=America/Anchorage:20070407T100000 EXDATE;TZID=America/Anchorage:20070405T100000 EXDATE;TZID=America/Anchorage:20070404T100000 BEGIN:VTIMEZONE TZID:America/Anchorage X-LIC-LOCATION:America/Anchorage BEGIN:STANDARD TZOFFSETFROM:-0800 TZOFFSETTO:-0900 TZNAME:AKST DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0900 TZOFFSETTO:-0800 TZNAME:AKDT DTSTART:19700405T020000 RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT END:VTIMEZONE</gd:recurrence> <gd:where valueString=''></gd:where> <gd:reminder minutes='10'></gd:reminder> <gd:recurrenceException specialized='true'> <gd:entryLink> <entry> <id>i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z</id> <published>2007-04-05T21:51:49.000Z</published> <updated>2007-04-05T21:52:58.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category> <title type='text'>testDavid</title> <content type='text'></content> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/event?eid=aTdsZ2ZqNjltanFqZ25vZGtsaWYzdmJtN2dfMjAwNzA0MDdUMTgwMDAwWiBnZGF0YS5vcHMudGVzdEBt' title='alternate'></link> <author> <name>gdata ops</name> <email>gdata.ops.test@gmail.com</email> </author> <gd:visibility value='http://schemas.google.com/g/2005#event.default'> </gd:visibility> <gd:originalEvent id='i7lgfj69mjqjgnodklif3vbm7g' href='http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g'> <gd:when startTime='2007-04-07T13:00:00.000-05:00'> </gd:when> </gd:originalEvent> <gCal:sendEventNotifications value='false'> </gCal:sendEventNotifications> <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency> <gd:eventStatus value='http://schemas.google.com/g/2005#event.canceled'> </gd:eventStatus> <gd:comments> <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z/comments'> <feed> <updated>2007-04-05T21:54:09.285Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#message'> </category> <title type='text'>Comments for: testDavid</title> <link rel='alternate' type='text/html' href='http://www.google.com/calendar/feeds/default/private/full/i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z/comments' title='alternate'></link> </feed> </gd:feedLink> </gd:comments> <gd:when startTime='2007-04-07T13:00:00.000-05:00' endTime='2007-04-07T14:00:00.000-05:00'> <gd:reminder minutes='10'></gd:reminder> </gd:when> <gd:where valueString=''></gd:where> </entry> </gd:entryLink> </gd:recurrenceException> </entry>""" NICK_ENTRY = """<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/nickname/2.0/Foo</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#nickname'/> <atom:title type="text">Foo</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/> <apps:nickname name="Foo"/> <apps:login userName="TestUser"/> </atom:entry>""" NICK_FEED = """<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:apps="http://schemas.google.com/apps/2006"> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#nickname'/> <atom:title type="text">Nicknames for user SusanJones</atom:title> <atom:link rel='http://schemas.google.com/g/2005#feed' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0"/> <atom:link rel='http://schemas.google.com/g/2005#post' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=TestUser"/> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>2</openSearch:itemsPerPage> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0/Foo </atom:id> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#nickname'/> <atom:title type="text">Foo</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/> <apps:nickname name="Foo"/> <apps:login userName="TestUser"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/nickname/2.0/suse </atom:id> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#nickname'/> <atom:title type="text">suse</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/Bar"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/nickname/2.0/Bar"/> <apps:nickname name="Bar"/> <apps:login userName="TestUser"/> </atom:entry> </atom:feed>""" USER_ENTRY = """<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/user/2.0/TestUser</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#user'/> <atom:title type="text">TestUser</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/user/2.0/TestUser"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/user/2.0/TestUser"/> <apps:login userName="TestUser" password="password" suspended="false" ipWhitelisted='false' hashFunctionName="SHA-1"/> <apps:name familyName="Test" givenName="User"/> <apps:quota limit="1024"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.nicknames' href="https://www.google.com/a/feeds/example.com/nickname/2.0?username=Test-3121"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.emailLists' href="https://www.google.com/a/feeds/example.com/emailList/2.0?recipient=testlist@example.com"/> </atom:entry>""" USER_FEED = """<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#user'/> <atom:title type="text">Users</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0?startUsername=john"/> <atom:link rel='http://schemas.google.com/g/2005#feed' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <atom:link rel='http://schemas.google.com/g/2005#post' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0/TestUser </atom:id> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#user'/> <atom:title type="text">TestUser</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/TestUser"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/TestUser"/> <gd:who rel='http://schemas.google.com/apps/2006#user.recipient' email="TestUser@example.com"/> <apps:login userName="TestUser" suspended="false"/> <apps:quota limit="2048"/> <apps:name familyName="Test" givenName="User"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.nicknames' href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=TestUser"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.emailLists' href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=TestUser@example.com"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith </atom:id> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#user'/> <atom:title type="text">JohnSmith</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/> <gd:who rel='http://schemas.google.com/apps/2006#user.recipient' email="JohnSmith@example.com"/> <apps:login userName="JohnSmith" suspended="false"/> <apps:quota limit="2048"/> <apps:name familyName="Smith" givenName="John"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.nicknames' href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=JohnSmith"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#user.emailLists' href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=JohnSmith@example.com"/> </atom:entry> </atom:feed>""" EMAIL_LIST_ENTRY = """<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> https://www.google.com/a/feeds/example.com/emailList/2.0/testlist </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList'/> <atom:title type="text">testlist</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/testlist"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/testlist"/> <apps:emailList name="testlist"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#emailList.recipients' href="http://www.google.com/a/feeds/example.com/emailList/2.0/testlist/recipient/"/> </atom:entry>""" EMAIL_LIST_FEED = """<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0 </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList'/> <atom:title type="text">EmailLists</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0?startEmailListName=john"/> <atom:link rel='http://schemas.google.com/g/2005#feed' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <atom:link rel='http://schemas.google.com/g/2005#post' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList'/> <atom:title type="text">us-sales</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/> <apps:emailList name="us-sales"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#emailList.recipients' href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList'/> <atom:title type="text">us-eng</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/> <apps:emailList name="us-eng"/> <gd:feedLink rel='http://schemas.google.com/apps/2006#emailList.recipients' href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng/recipient/"/> </atom:entry> </atom:feed>""" EMAIL_LIST_RECIPIENT_ENTRY = """<?xml version="1.0" encoding="UTF-8"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id>https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com</atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList.recipient'/> <atom:title type="text">TestUser</atom:title> <atom:link rel="self" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com"/> <gd:who email="TestUser@example.com"/> </atom:entry>""" EMAIL_LIST_RECIPIENT_FEED = """<?xml version="1.0" encoding="UTF-8"?> <atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005"> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList.recipient'/> <atom:title type="text">Recipients for email list us-sales</atom:title> <atom:link rel="next" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/?startRecipient=terry@example.com"/> <atom:link rel='http://schemas.google.com/g/2005#feed' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <atom:link rel='http://schemas.google.com/g/2005#post' type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/> <openSearch:startIndex>1</openSearch:startIndex> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList.recipient'/> <atom:title type="text">joe@example.com</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/> <gd:who email="joe@example.com"/> </atom:entry> <atom:entry> <atom:id> http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com </atom:id> <atom:updated>1970-01-01T00:00:00.000Z</atom:updated> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/apps/2006#emailList.recipient'/> <atom:title type="text">susan@example.com</atom:title> <atom:link rel="self" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/> <atom:link rel="edit" type="application/atom+xml" href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/> <gd:who email="susan@example.com"/> </atom:entry> </atom:feed>""" ACL_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gAcl='http://schemas.google.com/acl/2007'> <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full</id> <updated>2007-04-21T00:52:04.000Z</updated> <title type='text'>Elizabeth Bennet's access control list</title> <link rel='http://schemas.google.com/acl/2007#controlledObject' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/private/full'> </link> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'> </link> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'> </link> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'> </link> <generator version='1.0' uri='http://www.google.com/calendar'>Google Calendar</generator> <openSearch:totalResults>2</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <entry> <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com</id> <updated>2007-04-21T00:52:04.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'> </category> <title type='text'>owner</title> <content type='text'></content> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'> </link> <author> <name>Elizabeth Bennet</name> <email>liz@gmail.com</email> </author> <gAcl:scope type='user' value='liz@gmail.com'></gAcl:scope> <gAcl:role value='http://schemas.google.com/gCal/2005#owner'> </gAcl:role> </entry> <entry> <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default</id> <updated>2007-04-21T00:52:04.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'> </category> <title type='text'>read</title> <content type='text'></content> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default'> </link> <author> <name>Elizabeth Bennet</name> <email>liz@gmail.com</email> </author> <gAcl:scope type='default'></gAcl:scope> <gAcl:role value='http://schemas.google.com/gCal/2005#read'> </gAcl:role> </entry> </feed>""" ACL_ENTRY = """<?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gCal='http://schemas.google.com/gCal/2005' xmlns:gAcl='http://schemas.google.com/acl/2007'> <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com</id> <updated>2007-04-21T00:52:04.000Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/acl/2007#accessRule'> </category> <title type='text'>owner</title> <content type='text'></content> <link rel='self' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'> </link> <link rel='edit' type='application/atom+xml' href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'> </link> <author> <name>Elizabeth Bennet</name> <email>liz@gmail.com</email> </author> <gAcl:scope type='user' value='liz@gmail.com'></gAcl:scope> <gAcl:role value='http://schemas.google.com/gCal/2005#owner'> </gAcl:role> </entry>""" DOCUMENT_LIST_FEED = """<?xml version='1.0' encoding='UTF-8'?> <ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns1:totalResults xmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">2</ns1:totalResults><ns1:startIndex xmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">1</ns1:startIndex><ns0:entry><ns0:content src="http://foo.com/fm?fmcmd=102&amp;key=supercalifragilisticexpeadocious" type="text/html" /><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category label="spreadsheet" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#spreadsheet" /><ns0:id>http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpeadocious</ns0:id><ns0:link href="http://foo.com/ccc?key=supercalifragilisticexpeadocious" rel="alternate" type="text/html" /><ns0:link href="http://foo.com/feeds/worksheets/supercalifragilisticexpeadocious/private/full" rel="http://schemas.google.com/spreadsheets/2006#worksheetsfeed" type="application/atom+xml" /><ns0:link href="http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpeadocious" rel="self" type="application/atom+xml" /><ns0:title type="text">Test Spreadsheet</ns0:title><ns0:updated>2007-07-03T18:03:32.045Z</ns0:updated></ns0:entry><ns0:entry><ns0:content src="http://docs.google.com/RawDocContents?action=fetch&amp;docID=gr00vy" type="text/html" /><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category label="document" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document" /><ns0:id>http://docs.google.com/feeds/documents/private/full/document%3Agr00vy</ns0:id><ns0:link href="http://foobar.com/Doc?id=gr00vy" rel="alternate" type="text/html" /><ns0:link href="http://docs.google.com/feeds/documents/private/full/document%3Agr00vy" rel="self" type="application/atom+xml" /><ns0:title type="text">Test Document</ns0:title><ns0:updated>2007-07-03T18:02:50.338Z</ns0:updated></ns0:entry><ns0:id>http://docs.google.com/feeds/documents/private/full</ns0:id><ns0:link href="http://docs.google.com" rel="alternate" type="text/html" /><ns0:link href="http://docs.google.com/feeds/documents/private/full" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" /><ns0:link href="http://docs.google.com/feeds/documents/private/full" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" /><ns0:link href="http://docs.google.com/feeds/documents/private/full" rel="self" type="application/atom+xml" /><ns0:title type="text">Available Documents - test.user@gmail.com</ns0:title><ns0:updated>2007-07-09T23:07:21.898Z</ns0:updated></ns0:feed> """ DOCUMENT_LIST_ENTRY = """<?xml version='1.0' encoding='UTF-8'?> <ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:content src="http://foo.com/fm?fmcmd=102&amp;key=supercalifragilisticexpealidocious" type="text/html" /><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category label="spreadsheet" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#spreadsheet" /><ns0:id>http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpealidocious</ns0:id><ns0:link href="http://foo.com/ccc?key=supercalifragilisticexpealidocious" rel="alternate" type="text/html" /><ns0:link href="http://foo.com/feeds/worksheets/supercalifragilisticexpealidocious/private/full" rel="http://schemas.google.com/spreadsheets/2006#worksheetsfeed" type="application/atom+xml" /><ns0:link href="http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpealidocious" rel="self" type="application/atom+xml" /><ns0:title type="text">Test Spreadsheet</ns0:title><ns0:updated>2007-07-03T18:03:32.045Z</ns0:updated></ns0:entry> """ BATCH_ENTRY = """<?xml version='1.0' encoding='UTF-8'?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:g="http://base.google.com/ns/1.0"> <id>http://www.google.com/base/feeds/items/2173859253842813008</id> <published>2006-07-11T14:51:43.560Z</published> <updated>2006-07-11T14:51: 43.560Z</updated> <title type="text">title</title> <content type="html">content</content> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/items/2173859253842813008"/> <link rel="edit" type="application/atom+xml" href="http://www.google.com/base/feeds/items/2173859253842813008"/> <g:item_type>recipes</g:item_type> <batch:operation type="insert"/> <batch:id>itemB</batch:id> <batch:status code="201" reason="Created"/> </entry>""" BATCH_FEED_REQUEST = """<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:g="http://base.google.com/ns/1.0" xmlns:batch="http://schemas.google.com/gdata/batch"> <title type="text">My Batch Feed</title> <entry> <id>http://www.google.com/base/feeds/items/13308004346459454600</id> <batch:operation type="delete"/> </entry> <entry> <id>http://www.google.com/base/feeds/items/17437536661927313949</id> <batch:operation type="delete"/> </entry> <entry> <title type="text">...</title> <content type="html">...</content> <batch:id>itemA</batch:id> <batch:operation type="insert"/> <g:item_type>recipes</g:item_type> </entry> <entry> <title type="text">...</title> <content type="html">...</content> <batch:id>itemB</batch:id> <batch:operation type="insert"/> <g:item_type>recipes</g:item_type> </entry> </feed>""" BATCH_FEED_RESULT = """<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:g="http://base.google.com/ns/1.0" xmlns:batch="http://schemas.google.com/gdata/batch"> <id>http://www.google.com/base/feeds/items</id> <updated>2006-07-11T14:51:42.894Z</updated> <title type="text">My Batch</title> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/base/feeds/items"/> <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/base/feeds/items"/> <link rel=" http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="http://www.google.com/base/feeds/items/batch"/> <entry> <id>http://www.google.com/base/feeds/items/2173859253842813008</id> <published>2006-07-11T14:51:43.560Z</published> <updated>2006-07-11T14:51: 43.560Z</updated> <title type="text">...</title> <content type="html">...</content> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/items/2173859253842813008"/> <link rel="edit" type="application/atom+xml" href="http://www.google.com/base/feeds/items/2173859253842813008"/> <g:item_type>recipes</g:item_type> <batch:operation type="insert"/> <batch:id>itemB</batch:id> <batch:status code="201" reason="Created"/> </entry> <entry> <id>http://www.google.com/base/feeds/items/11974645606383737963</id> <published>2006-07-11T14:51:43.247Z</published> <updated>2006-07-11T14:51: 43.247Z</updated> <title type="text">...</title> <content type="html">...</content> <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/items/11974645606383737963"/> <link rel="edit" type="application/atom+xml" href="http://www.google.com/base/feeds/items/11974645606383737963"/> <g:item_type>recipes</g:item_type> <batch:operation type="insert"/> <batch:id>itemA</batch:id> <batch:status code="201" reason="Created"/> </entry> <entry> <id>http://www.google.com/base/feeds/items/13308004346459454600</id> <updated>2006-07-11T14:51:42.894Z</updated> <title type="text">Error</title> <content type="text">Bad request</content> <batch:status code="404" reason="Bad request" content-type="application/xml"> <errors> <error type="request" reason="Cannot find item"/> </errors> </batch:status> </entry> <entry> <id>http://www.google.com/base/feeds/items/17437536661927313949</id> <updated>2006-07-11T14:51:43.246Z</updated> <content type="text">Deleted</content> <batch:operation type="delete"/> <batch:status code="200" reason="Success"/> </entry> </feed>""" ALBUM_FEED = """<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:exif="http://schemas.google.com/photos/exif/2007" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gml="http://www.opengis.net/gml" xmlns:georss="http://www.georss.org/georss" xmlns:photo="http://www.pheed.com/pheed/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gphoto="http://schemas.google.com/photos/2007"> <id>http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1</id> <updated>2007-09-21T18:23:05.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#album"/> <title type="text">Test</title> <subtitle type="text"/> <rights type="text">public</rights> <icon>http://lh6.google.com/sample.user/Rt8WNoDZEJE/AAAAAAAAABk/HQGlDhpIgWo/s160-c/Test.jpg</icon> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1"/> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test"/> <link rel="http://schemas.google.com/photos/2007#slideshow" type="application/x-shockwave-flash" href="http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fsample.user%2Falbumid%2F1%3Falt%3Drss"/> <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1?start-index=1&amp;max-results=500&amp;kind=photo%2Ctag"/> <author> <name>sample</name> <uri>http://picasaweb.google.com/sample.user</uri> </author> <generator version="1.00" uri="http://picasaweb.google.com/">Picasaweb</generator> <openSearch:totalResults>4</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>500</openSearch:itemsPerPage> <gphoto:id>1</gphoto:id> <gphoto:name>Test</gphoto:name> <gphoto:location/> <gphoto:access>public</gphoto:access> <gphoto:timestamp>1188975600000</gphoto:timestamp> <gphoto:numphotos>2</gphoto:numphotos> <gphoto:user>sample.user</gphoto:user> <gphoto:nickname>sample</gphoto:nickname> <gphoto:commentingEnabled>true</gphoto:commentingEnabled> <gphoto:commentCount>0</gphoto:commentCount> <entry> <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/2</id> <published>2007-09-05T20:49:23.000Z</published> <updated>2007-09-21T18:23:05.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#photo"/> <title type="text">Aqua Blue.jpg</title> <summary type="text">Blue</summary> <content type="image/jpeg" src="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/Aqua%20Blue.jpg"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1/photoid/2"/> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test/photo#2"/> <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/2"/> <gphoto:id>2</gphoto:id> <gphoto:version>1190398985145172</gphoto:version> <gphoto:position>0.0</gphoto:position> <gphoto:albumid>1</gphoto:albumid> <gphoto:width>2560</gphoto:width> <gphoto:height>1600</gphoto:height> <gphoto:size>883405</gphoto:size> <gphoto:client/> <gphoto:checksum/> <gphoto:timestamp>1189025362000</gphoto:timestamp> <exif:tags> <exif:flash>true</exif:flash> <exif:imageUniqueID>c041ce17aaa637eb656c81d9cf526c24</exif:imageUniqueID> </exif:tags> <gphoto:commentingEnabled>true</gphoto:commentingEnabled> <gphoto:commentCount>1</gphoto:commentCount> <media:group> <media:title type="plain">Aqua Blue.jpg</media:title> <media:description type="plain">Blue</media:description> <media:keywords>tag, test</media:keywords> <media:content url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/Aqua%20Blue.jpg" height="1600" width="2560" type="image/jpeg" medium="image"/> <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s72/Aqua%20Blue.jpg" height="45" width="72"/> <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s144/Aqua%20Blue.jpg" height="90" width="144"/> <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s288/Aqua%20Blue.jpg" height="180" width="288"/> <media:credit>sample</media:credit> </media:group> </entry> <entry> <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/3</id> <published>2007-09-05T20:49:24.000Z</published> <updated>2007-09-21T18:19:38.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#photo"/> <title type="text">Aqua Graphite.jpg</title> <summary type="text">Gray</summary> <content type="image/jpeg" src="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/Aqua%20Graphite.jpg"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1/photoid/3"/> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test/photo#3"/> <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/3"/> <gphoto:id>3</gphoto:id> <gphoto:version>1190398778006402</gphoto:version> <gphoto:position>1.0</gphoto:position> <gphoto:albumid>1</gphoto:albumid> <gphoto:width>2560</gphoto:width> <gphoto:height>1600</gphoto:height> <gphoto:size>798334</gphoto:size> <gphoto:client/> <gphoto:checksum/> <gphoto:timestamp>1189025363000</gphoto:timestamp> <exif:tags> <exif:flash>true</exif:flash> <exif:imageUniqueID>a5ce2e36b9df7d3cb081511c72e73926</exif:imageUniqueID> </exif:tags> <gphoto:commentingEnabled>true</gphoto:commentingEnabled> <gphoto:commentCount>0</gphoto:commentCount> <media:group> <media:title type="plain">Aqua Graphite.jpg</media:title> <media:description type="plain">Gray</media:description> <media:keywords/> <media:content url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/Aqua%20Graphite.jpg" height="1600" width="2560" type="image/jpeg" medium="image"/> <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s72/Aqua%20Graphite.jpg" height="45" width="72"/> <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s144/Aqua%20Graphite.jpg" height="90" width="144"/> <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s288/Aqua%20Graphite.jpg" height="180" width="288"/> <media:credit>sample</media:credit> </media:group> </entry> <entry> <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/tag</id> <updated>2007-09-05T20:49:24.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#tag"/> <title type="text">tag</title> <summary type="text">tag</summary> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/lh/searchbrowse?q=tag&amp;psc=G&amp;uname=sample.user&amp;filter=0"/> <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/tag"/> <author> <name>sample</name> <uri>http://picasaweb.google.com/sample.user</uri> </author> </entry> <entry> <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/test</id> <updated>2007-09-05T20:49:24.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#tag"/> <title type="text">test</title> <summary type="text">test</summary> <link rel="alternate" type="text/html" href="http://picasaweb.google.com/lh/searchbrowse?q=test&amp;psc=G&amp;uname=sample.user&amp;filter=0"/> <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/test"/> <author> <name>sample</name> <uri>http://picasaweb.google.com/sample.user</uri> </author> </entry> </feed>""" CODE_SEARCH_FEED = """<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gcs="http://schemas.google.com/codesearch/2006" xml:base="http://www.google.com"> <id>http://www.google.com/codesearch/feeds/search?q=malloc</id> <updated>2007-12-19T16:08:04Z</updated> <title type="text">Google Code Search</title> <generator version="1.0" uri="http://www.google.com/codesearch">Google Code Search</generator> <opensearch:totalResults>2530000</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <author> <name>Google Code Search</name> <uri>http://www.google.com/codesearch</uri> </author> <link rel="http://schemas.google.com/g/2006#feed" type="application/atom+xml" href="http://schemas.google.com/codesearch/2006"/> <link rel="self" type="application/atom+xml" href="http://www.google.com/codesearch/feeds/search?q=malloc"/> <link rel="next" type="application/atom+xml" href="http://www.google.com/codesearch/feeds/search?q=malloc&amp;start-index=11"/> <link rel="alternate" type="text/html" href="http://www.google.com/codesearch?q=malloc"/> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:LDjwp-Iqc7U:84hEYaYsZk8:xDGReDhvNi0&amp;sa=N&amp;ct=rx&amp;cd=1&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">software/autoconf/manual/autoconf-2.60/autoconf.html</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:LDjwp-Iqc7U:84hEYaYsZk8:xDGReDhvNi0&amp;sa=N&amp;ct=rx&amp;cd=1&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002#first"/><gcs:package name="http://www.gnu.org" uri="http://www.gnu.org"></gcs:package><gcs:file name="software/autoconf/manual/autoconf-2.60/autoconf.html-002"></gcs:file><content type="text/html">&lt;pre&gt; 8: void *&lt;b&gt;malloc&lt;/b&gt; (); &lt;/pre&gt;</content><gcs:match lineNumber="4" type="text/html">&lt;pre&gt; #undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="8" type="text/html">&lt;pre&gt; void *&lt;b&gt;malloc&lt;/b&gt; (); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="14" type="text/html">&lt;pre&gt; rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="18" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n); &lt;/pre&gt;</gcs:match></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:h4hfh-fV-jI:niBq_bwWZNs:H0OhClf0HWQ&amp;sa=N&amp;ct=rx&amp;cd=2&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">guile-1.6.8/libguile/mallocs.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:h4hfh-fV-jI:niBq_bwWZNs:H0OhClf0HWQ&amp;sa=N&amp;ct=rx&amp;cd=2&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c#first"/><gcs:package name="ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz" uri="ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz"></gcs:package><gcs:file name="guile-1.6.8/libguile/mallocs.c"></gcs:file><content type="text/html">&lt;pre&gt; 86: { scm_t_bits mem = n ? (scm_t_bits) &lt;b&gt;malloc&lt;/b&gt; (n) : 0; if (n &amp;amp;&amp;amp; !mem) &lt;/pre&gt;</content><gcs:match lineNumber="54" type="text/html">&lt;pre&gt;#include &amp;lt;&lt;b&gt;malloc&lt;/b&gt;.h&amp;gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="62" type="text/html">&lt;pre&gt;scm_t_bits scm_tc16_&lt;b&gt;malloc&lt;/b&gt;; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="66" type="text/html">&lt;pre&gt;&lt;b&gt;malloc&lt;/b&gt;_free (SCM ptr) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="75" type="text/html">&lt;pre&gt;&lt;b&gt;malloc&lt;/b&gt;_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="77" type="text/html">&lt;pre&gt; scm_puts(&amp;quot;#&amp;lt;&lt;b&gt;malloc&lt;/b&gt; &amp;quot;, port); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="87" type="text/html">&lt;pre&gt; scm_t_bits mem = n ? (scm_t_bits) &lt;b&gt;malloc&lt;/b&gt; (n) : 0; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="90" type="text/html">&lt;pre&gt; SCM_RETURN_NEWSMOB (scm_tc16_&lt;b&gt;malloc&lt;/b&gt;, mem); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="98" type="text/html">&lt;pre&gt; scm_tc16_&lt;b&gt;malloc&lt;/b&gt; = scm_make_smob_type (&amp;quot;&lt;b&gt;malloc&lt;/b&gt;&amp;quot;, 0); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="99" type="text/html">&lt;pre&gt; scm_set_smob_free (scm_tc16_&lt;b&gt;malloc&lt;/b&gt;, &lt;b&gt;malloc&lt;/b&gt;_free); &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:9wyZUG-N_30:7_dFxoC1ZrY:C0_iYbFj90M&amp;sa=N&amp;ct=rx&amp;cd=3&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">bash-3.0/lib/malloc/alloca.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:9wyZUG-N_30:7_dFxoC1ZrY:C0_iYbFj90M&amp;sa=N&amp;ct=rx&amp;cd=3&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz" uri="http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz"></gcs:package><gcs:file name="bash-3.0/lib/malloc/alloca.c"></gcs:file><content type="text/html">&lt;pre&gt; 78: #ifndef emacs #define &lt;b&gt;malloc&lt;/b&gt; x&lt;b&gt;malloc&lt;/b&gt; extern pointer x&lt;b&gt;malloc&lt;/b&gt; (); &lt;/pre&gt;</content><gcs:match lineNumber="69" type="text/html">&lt;pre&gt; &lt;b&gt;malloc&lt;/b&gt;. The Emacs executable needs alloca to call x&lt;b&gt;malloc&lt;/b&gt;, because &lt;/pre&gt;</gcs:match><gcs:match lineNumber="70" type="text/html">&lt;pre&gt; ordinary &lt;b&gt;malloc&lt;/b&gt; isn&amp;#39;t protected from input signals. On the other &lt;/pre&gt;</gcs:match><gcs:match lineNumber="71" type="text/html">&lt;pre&gt; hand, the utilities in lib-src need alloca to call &lt;b&gt;malloc&lt;/b&gt;; some of &lt;/pre&gt;</gcs:match><gcs:match lineNumber="72" type="text/html">&lt;pre&gt; them are very simple, and don&amp;#39;t have an x&lt;b&gt;malloc&lt;/b&gt; routine. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="76" type="text/html">&lt;pre&gt; Callers below should use &lt;b&gt;malloc&lt;/b&gt;. */ &lt;/pre&gt;</gcs:match><gcs:match lineNumber="79" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt; x&lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="80" type="text/html">&lt;pre&gt;extern pointer x&lt;b&gt;malloc&lt;/b&gt; (); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="132" type="text/html">&lt;pre&gt; It is very important that sizeof(header) agree with &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="198" type="text/html">&lt;pre&gt; register pointer new = &lt;b&gt;malloc&lt;/b&gt; (sizeof (header) + size); &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:uhVCKyPcT6k:8juMxxzmUJw:H7_IDsTB2L4&amp;sa=N&amp;ct=rx&amp;cd=4&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">mozilla/xpcom/build/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:uhVCKyPcT6k:8juMxxzmUJw:H7_IDsTB2L4&amp;sa=N&amp;ct=rx&amp;cd=4&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c#first"/><gcs:package name="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2" uri="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2"></gcs:package><gcs:file name="mozilla/xpcom/build/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 54: http://gee.cs.oswego.edu/dl/html/&lt;b&gt;malloc&lt;/b&gt;.html You may already by default be using a c library containing a &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</content><gcs:match lineNumber="4" type="text/html">&lt;pre&gt;/* ---------- To make a &lt;b&gt;malloc&lt;/b&gt;.h, start cutting here ------------ */ &lt;/pre&gt;</gcs:match><gcs:match lineNumber="22" type="text/html">&lt;pre&gt; Note: There may be an updated version of this &lt;b&gt;malloc&lt;/b&gt; obtainable at &lt;/pre&gt;</gcs:match><gcs:match lineNumber="23" type="text/html">&lt;pre&gt; ftp://gee.cs.oswego.edu/pub/misc/&lt;b&gt;malloc&lt;/b&gt;.c &lt;/pre&gt;</gcs:match><gcs:match lineNumber="34" type="text/html">&lt;pre&gt;* Why use this &lt;b&gt;malloc&lt;/b&gt;? &lt;/pre&gt;</gcs:match><gcs:match lineNumber="37" type="text/html">&lt;pre&gt; most tunable &lt;b&gt;malloc&lt;/b&gt; ever written. However it is among the fastest &lt;/pre&gt;</gcs:match><gcs:match lineNumber="40" type="text/html">&lt;pre&gt; allocator for &lt;b&gt;malloc&lt;/b&gt;-intensive programs. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="54" type="text/html">&lt;pre&gt; http://gee.cs.oswego.edu/dl/html/&lt;b&gt;malloc&lt;/b&gt;.html &lt;/pre&gt;</gcs:match><gcs:match lineNumber="56" type="text/html">&lt;pre&gt; You may already by default be using a c library containing a &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="57" type="text/html">&lt;pre&gt; that is somehow based on some version of this &lt;b&gt;malloc&lt;/b&gt; (for example in &lt;/pre&gt;</gcs:match><rights>Mozilla</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:4n1P2HVOISs:Ybbpph0wR2M:OhIN_sDrG0U&amp;sa=N&amp;ct=rx&amp;cd=5&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:4n1P2HVOISs:Ybbpph0wR2M:OhIN_sDrG0U&amp;sa=N&amp;ct=rx&amp;cd=5&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh#first"/><gcs:package name="http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz" uri="http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz"></gcs:package><gcs:file name="hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh"></gcs:file><content type="text/html">&lt;pre&gt; 11: echo ================ unit-must-&lt;b&gt;malloc&lt;/b&gt; tests ================ ./unit-must-&lt;b&gt;malloc&lt;/b&gt; echo ...passed &lt;/pre&gt;</content><gcs:match lineNumber="2" type="text/html">&lt;pre&gt;# tag: Tom Lord Tue Dec 4 14:54:29 2001 (mem-tests/unit-must-&lt;b&gt;malloc&lt;/b&gt;.sh) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="11" type="text/html">&lt;pre&gt;echo ================ unit-must-&lt;b&gt;malloc&lt;/b&gt; tests ================ &lt;/pre&gt;</gcs:match><gcs:match lineNumber="12" type="text/html">&lt;pre&gt;./unit-must-&lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:GzkwiWG266M:ykuz3bG00ws:2sTvVSif08g&amp;sa=N&amp;ct=rx&amp;cd=6&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">tar-1.14/lib/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:GzkwiWG266M:ykuz3bG00ws:2sTvVSif08g&amp;sa=N&amp;ct=rx&amp;cd=6&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2" uri="http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2"></gcs:package><gcs:file name="tar-1.14/lib/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 22: #endif #undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* Work around bug on some systems where &lt;b&gt;malloc&lt;/b&gt; (0) fails. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="23" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="31" type="text/html">&lt;pre&gt;rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="35" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n); &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:o_TFIeBY6dY:ktI_dt8wPao:AI03BD1Dz0Y&amp;sa=N&amp;ct=rx&amp;cd=7&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">tar-1.16.1/lib/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:o_TFIeBY6dY:ktI_dt8wPao:AI03BD1Dz0Y&amp;sa=N&amp;ct=rx&amp;cd=7&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz" uri="http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz"></gcs:package><gcs:file name="tar-1.16.1/lib/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 21: #include &amp;lt;config.h&amp;gt; #undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* &lt;b&gt;malloc&lt;/b&gt;() function that is glibc compatible. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="22" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="30" type="text/html">&lt;pre&gt;rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n) &lt;/pre&gt;</gcs:match><gcs:match lineNumber="34" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n); &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:_ibw-VLkMoI:jBOtIJSmFd4:-0NUEVeCwfY&amp;sa=N&amp;ct=rx&amp;cd=8&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">uClibc-0.9.29/include/malloc.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:_ibw-VLkMoI:jBOtIJSmFd4:-0NUEVeCwfY&amp;sa=N&amp;ct=rx&amp;cd=8&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h#first"/><gcs:package name="http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2" uri="http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2"></gcs:package><gcs:file name="uClibc-0.9.29/include/malloc.h"></gcs:file><content type="text/html">&lt;pre&gt; 1: /* Prototypes and definition for &lt;b&gt;malloc&lt;/b&gt; implementation. Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc. &lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* Prototypes and definition for &lt;b&gt;malloc&lt;/b&gt; implementation. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="26" type="text/html">&lt;pre&gt; `pt&lt;b&gt;malloc&lt;/b&gt;&amp;#39;, a &lt;b&gt;malloc&lt;/b&gt; implementation for multiple threads without &lt;/pre&gt;</gcs:match><gcs:match lineNumber="28" type="text/html">&lt;pre&gt; See the files `pt&lt;b&gt;malloc&lt;/b&gt;.c&amp;#39; or `COPYRIGHT&amp;#39; for copying conditions. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="32" type="text/html">&lt;pre&gt; This work is mainly derived from &lt;b&gt;malloc&lt;/b&gt;-2.6.4 by Doug Lea &lt;/pre&gt;</gcs:match><gcs:match lineNumber="35" type="text/html">&lt;pre&gt; ftp://g.oswego.edu/pub/misc/&lt;b&gt;malloc&lt;/b&gt;.c &lt;/pre&gt;</gcs:match><gcs:match lineNumber="40" type="text/html">&lt;pre&gt; `pt&lt;b&gt;malloc&lt;/b&gt;.c&amp;#39;. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="45" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_ptr_t void * &lt;/pre&gt;</gcs:match><gcs:match lineNumber="51" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_ptr_t char * &lt;/pre&gt;</gcs:match><gcs:match lineNumber="56" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_size_t size_t &lt;/pre&gt;</gcs:match><rights>LGPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:F6qHcZ9vefo:bTX7o9gKfks:hECF4r_eKC0&amp;sa=N&amp;ct=rx&amp;cd=9&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">glibc-2.0.1/hurd/hurdmalloc.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:F6qHcZ9vefo:bTX7o9gKfks:hECF4r_eKC0&amp;sa=N&amp;ct=rx&amp;cd=9&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h#first"/><gcs:package name="http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz" uri="http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz"></gcs:package><gcs:file name="glibc-2.0.1/hurd/hurdmalloc.h"></gcs:file><content type="text/html">&lt;pre&gt; 15: #define &lt;b&gt;malloc&lt;/b&gt; _hurd_&lt;b&gt;malloc&lt;/b&gt; #define realloc _hurd_realloc &lt;/pre&gt;</content><gcs:match lineNumber="3" type="text/html">&lt;pre&gt; All hurd-internal code which uses &lt;b&gt;malloc&lt;/b&gt; et al includes this file so it &lt;/pre&gt;</gcs:match><gcs:match lineNumber="4" type="text/html">&lt;pre&gt; will use the internal &lt;b&gt;malloc&lt;/b&gt; routines _hurd_{&lt;b&gt;malloc&lt;/b&gt;,realloc,free} &lt;/pre&gt;</gcs:match><gcs:match lineNumber="7" type="text/html">&lt;pre&gt; of &lt;b&gt;malloc&lt;/b&gt; et al is the unixoid one using sbrk. &lt;/pre&gt;</gcs:match><gcs:match lineNumber="11" type="text/html">&lt;pre&gt;extern void *_hurd_&lt;b&gt;malloc&lt;/b&gt; (size_t); &lt;/pre&gt;</gcs:match><gcs:match lineNumber="15" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt; _hurd_&lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><rights>GPL</rights></entry> <entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:CHUvHYzyLc8:pdcAfzDA6lY:wjofHuNLTHg&amp;sa=N&amp;ct=rx&amp;cd=10&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:CHUvHYzyLc8:pdcAfzDA6lY:wjofHuNLTHg&amp;sa=N&amp;ct=rx&amp;cd=10&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h#first"/><gcs:package name="ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2" uri="ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2"></gcs:package><gcs:file name="httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h"></gcs:file><content type="text/html">&lt;pre&gt; 173: #undef &lt;b&gt;malloc&lt;/b&gt; #define &lt;b&gt;malloc&lt;/b&gt;(x) library_&lt;b&gt;malloc&lt;/b&gt;(gLibHandle,x) &lt;/pre&gt;</content><gcs:match lineNumber="170" type="text/html">&lt;pre&gt;/* Redefine &lt;b&gt;malloc&lt;/b&gt; to use the library &lt;b&gt;malloc&lt;/b&gt; call so &lt;/pre&gt;</gcs:match><gcs:match lineNumber="173" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt; &lt;/pre&gt;</gcs:match><gcs:match lineNumber="174" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt;(x) library_&lt;b&gt;malloc&lt;/b&gt;(gLibHandle,x) &lt;/pre&gt;</gcs:match><rights>Apache</rights></entry> </feed>""" YOU_TUBE_VIDEO_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gml='http://www.opengis.net/gml' xmlns:georss='http://www.georss.org/georss' xmlns:media='http://search.yahoo.com/mrss/' xmlns:yt='http://gdata.youtube.com/schemas/2007' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://gdata.youtube.com/feeds/api/standardfeeds/top_rated</id> <updated>2008-02-21T18:57:10.801Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/> <title type='text'>Top Rated</title> <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo> <link rel='alternate' type='text/html' href='http://www.youtube.com/browser?s=tr'/> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/standardfeeds/top_rated'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?start_index=1&amp;max-results=25'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?start_index=26&amp;max-results=25'/> <author> <name>YouTube</name> <uri>http://www.youtube.com/</uri> </author> <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator> <openSearch:totalResults>99</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b</id> <published>2007-02-16T20:22:57.000Z</published> <updated>2007-02-16T20:22:57.000Z</updated> <category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/> <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Steventon"/> <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="walk"/> <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Darcy"/> <category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Entertainment" label="Entertainment"/> <title type="text">My walk with Mr. Darcy</title> <content type="html"><div ... html content trimmed ...></content> <link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b"/> <link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=ZTUVgYoeN_b"/> <link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/responses"/> <link rel="http://gdata.youtube.com/schemas/2007#video.ratings" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/ratings"/> <link rel="http://gdata.youtube.com/schemas/2007#video.complaints" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/complaints"/> <link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/related"/> <author> <name>Andy Samplo</name> <uri>http://gdata.youtube.com/feeds/api/users/andyland74</uri> </author> <media:group> <media:title type="plain">Shopping for Coats</media:title> <media:description type="plain"> What could make for more exciting video? </media:description> <media:keywords>Shopping, parkas</media:keywords> <yt:duration seconds="79"/> <media:category label="People" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People </media:category> <media:content url='http://www.youtube.com/v/ZTUVgYoeN_b' type='application/x-shockwave-flash' medium='video' isDefault='true' expression="full" duration='215' yt:format="5"/> <media:content url='rtsp://rtsp2.youtube.com/ChoLENy73bIAEQ1k30OPEgGDA==/0/0/0/video.3gp' type='video/3gpp' medium='video' expression="full" duration='215' yt:format="1"/> <media:content url='rtsp://rtsp2.youtube.com/ChoLENy73bIAEQ1k30OPEgGDA==/0/0/0/video.3gp' type='video/3gpp' medium='video' expression="full" duration='215' yt:format="6"/> <media:player url="http://www.youtube.com/watch?v=ZTUVgYoeN_b"/> <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/2.jpg" height="97" width="130" time="00:00:03.500"/> <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/1.jpg" height="97" width="130" time="00:00:01.750"/> <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/3.jpg" height="97" width="130" time="00:00:05.250"/> <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/0.jpg" height="240" width="320" time="00:00:03.500"/> </media:group> <yt:statistics viewCount="93"/> <gd:rating min='1' max='5' numRaters='435' average='4.94'/> <gd:comments> <gd:feedLink href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments" countHint='2197'/> </gd:comments> </entry> </feed>""" YOU_TUBE_COMMENT_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'> <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=1&amp;max-results=25</id> <updated>2008-02-25T23:14:03.148Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#comment'/> <title type='text'>Comments on 'My walk with Mr. Darcy'</title> <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=ZTUVgYoeN_b'/> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=1&amp;max-results=25'/> <link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=26&amp;max-results=25'/> <author> <name>YouTube</name> <uri>http://www.youtube.com/</uri> </author> <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator> <openSearch:totalResults>100</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments/7F2BAAD03653A691</id> <published>2007-05-23T00:21:59.000-07:00</published> <updated>2007-05-23T00:21:59.000-07:00</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#comment'/> <title type='text'>Walking is fun.</title> <content type='text'>Walking is fun.</content> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=ZTUVgYoeN_b'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments/7F2BAAD03653A691'/> <author> <name>andyland744</name> <uri>http://gdata.youtube.com/feeds/api/users/andyland744</uri> </author> </entry> </feed>""" YOU_TUBE_PLAYLIST_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:yt='http://gdata.youtube.com/schemas/2007' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://gdata.youtube.com/feeds/users/andyland74/playlists?start-index=1&amp;max-results=25</id> <updated>2008-02-26T00:26:15.635Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#playlistLink'/> <title type='text'>andyland74's Playlists</title> <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/profile_play_list?user=andyland74'/> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists?start-index=1&amp;max-results=25'/> <author> <name>andyland74</name> <uri>http://gdata.youtube.com/feeds/users/andyland74</uri> </author> <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://gdata.youtube.com/feeds/users/andyland74/playlists/8BCDD04DE8F771B2</id> <published>2007-11-04T17:30:27.000-08:00</published> <updated>2008-02-22T09:55:14.000-08:00</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#playlistLink'/> <title type='text'>My New Playlist Title</title> <content type='text'>My new playlist Description</content> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/view_play_list?p=8BCDD04DE8F771B2'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists/8BCDD04DE8F771B2'/> <author> <name>andyland74</name> <uri>http://gdata.youtube.com/feeds/users/andyland74</uri> </author> <yt:description>My new playlist Description</yt:description> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#playlist' href='http://gdata.youtube.com/feeds/playlists/8BCDD04DE8F771B2'/> </entry> </feed>""" YOU_TUBE_SUBSCRIPTIONS_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:yt='http://gdata.youtube.com/schemas/2007' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://gdata.youtube.com/feeds/users/andyland74/subscriptions?start-index=1&amp;max-results=25</id> <updated>2008-02-26T00:26:15.635Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#subscription'/> <title type='text'>andyland74's Subscriptions</title> <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/profile_subscriptions?user=andyland74'/> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions?start-index=1&amp;max-results=25'/> <author> <name>andyland74</name> <uri>http://gdata.youtube.com/feeds/users/andyland74</uri> </author> <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://gdata.youtube.com/feeds/users/andyland74/subscriptions/d411759045e2ad8c</id> <published>2007-11-04T17:30:27.000-08:00</published> <updated>2008-02-22T09:55:14.000-08:00</updated> <category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat' term='channel'/> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#subscription'/> <title type='text'>Videos published by : NBC</title> <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/> <link rel='alternate' type='text/html' href='http://www.youtube.com/profile_videos?user=NBC'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions/d411759045e2ad8c'/> <author> <name>andyland74</name> <uri>http://gdata.youtube.com/feeds/users/andyland74</uri> </author> <yt:username>NBC</yt:username> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.uploads' href='http://gdata.youtube.com/feeds/api/users/nbc/uploads'/> </entry> </feed>""" YOU_TUBE_PROFILE = """<?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:yt='http://gdata.youtube.com/schemas/2007' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://gdata.youtube.com/feeds/users/andyland74</id> <published>2006-10-16T00:09:45.000-07:00</published> <updated>2008-02-26T11:48:21.000-08:00</updated> <category scheme='http://gdata.youtube.com/schemas/2007/channeltypes.cat' term='Standard'/> <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#userProfile'/> <title type='text'>andyland74 Channel</title> <link rel='alternate' type='text/html' href='http://www.youtube.com/profile?user=andyland74'/> <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/> <author> <name>andyland74</name> <uri>http://gdata.youtube.com/feeds/users/andyland74</uri> </author> <yt:age>33</yt:age> <yt:username>andyland74</yt:username> <yt:books>Catch-22</yt:books> <yt:gender>m</yt:gender> <yt:company>Google</yt:company> <yt:hobbies>Testing YouTube APIs</yt:hobbies> <yt:location>US</yt:location> <yt:movies>Aqua Teen Hungerforce</yt:movies> <yt:music>Elliott Smith</yt:music> <yt:occupation>Technical Writer</yt:occupation> <yt:school>University of North Carolina</yt:school> <media:thumbnail url='http://i.ytimg.com/vi/YFbSxcdOL-w/default.jpg'/> <yt:statistics viewCount='9' videoWatchCount='21' subscriberCount='1' lastWebAccess='2008-02-25T16:03:38.000-08:00'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.favorites' href='http://gdata.youtube.com/feeds/users/andyland74/favorites' countHint='4'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.contacts' href='http://gdata.youtube.com/feeds/users/andyland74/contacts' countHint='1'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.inbox' href='http://gdata.youtube.com/feeds/users/andyland74/inbox' countHint='0'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.playlists' href='http://gdata.youtube.com/feeds/users/andyland74/playlists'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.subscriptions' href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions' countHint='4'/> <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.uploads' href='http://gdata.youtube.com/feeds/users/andyland74/uploads' countHint='1'/> </entry>""" NEW_CONTACT = """<?xml version='1.0' encoding='UTF-8'?> <atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'> <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' /> <atom:title type='text'>Elizabeth Bennet</atom:title> <atom:content type='text'>Notes</atom:content> <gd:email rel='http://schemas.google.com/g/2005#work' address='liz@gmail.com' /> <gd:email rel='http://schemas.google.com/g/2005#home' address='liz@example.org' /> <gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(206)555-1212</gd:phoneNumber> <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>(206)555-1213</gd:phoneNumber> <gd:im address='liz@gmail.com' protocol='http://schemas.google.com/g/2005#GOOGLE_TALK' rel='http://schemas.google.com/g/2005#home' /> <gd:postalAddress rel='http://schemas.google.com/g/2005#work' primary='true'>1600 Amphitheatre Pkwy Mountain View</gd:postalAddress> </atom:entry>""" CONTACTS_FEED = """<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005'> <id>http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base</id> <updated>2008-03-05T12:36:38.836Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' /> <title type='text'>Contacts</title> <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base' /> <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base' /> <link rel='self' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base?max-results=25' /> <author> <name>Elizabeth Bennet</name> <email>liz@gmail.com</email> </author> <generator version='1.0' uri='http://www.google.com/m8/feeds/contacts'>Contacts</generator> <openSearch:totalResults>1</openSearch:totalResults> <openSearch:startIndex>1</openSearch:startIndex> <openSearch:itemsPerPage>25</openSearch:itemsPerPage> <entry> <id>http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de</id> <updated>2008-03-05T12:36:38.835Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' /> <title type='text'>Fitzgerald</title> <link rel='self' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de' /> <link rel='edit' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de/1204720598835000' /> <gd:phoneNumber rel='http://schemas.google.com/g/2005#home' primary='true'>456</gd:phoneNumber> </entry> </feed>"""
xml_entry_1 = '<?xml version=\'1.0\'?>\n<entry xmlns=\'http://www.w3.org/2005/Atom\'\n xmlns:g=\'http://base.google.com/ns/1.0\'>\n <category scheme="http://base.google.com/categories/itemtypes"\n term="products"/>\n <id> http://www.google.com/test/id/url </id>\n <title type=\'text\'>Testing 2000 series laptop</title>\n <content type=\'xhtml\'>\n <div xmlns=\'http://www.w3.org/1999/xhtml\'>A Testing Laptop</div>\n </content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.provider-host.com/123456789\'/>\n <link rel=\'license\' \n href=\'http://creativecommons.org/licenses/by-nc/2.5/rdf\'/>\n <g:label>Computer</g:label>\n <g:label>Laptop</g:label>\n <g:label>testing laptop</g:label>\n <g:item_type>products</g:item_type>\n</entry>' test_base_entry = '<?xml version=\'1.0\'?>\n<entry xmlns=\'http://www.w3.org/2005/Atom\'\n xmlns:g=\'http://base.google.com/ns/1.0\'>\n <category scheme="http://base.google.com/categories/itemtypes"\n term="products"/>\n <title type=\'text\'>Testing 2000 series laptop</title>\n <content type=\'xhtml\'>\n <div xmlns=\'http://www.w3.org/1999/xhtml\'>A Testing Laptop</div>\n </content>\n <app:control xmlns:app=\'http://purl.org/atom/app#\'>\n <app:draft>yes</app:draft>\n <gm:disapproved xmlns:gm=\'http://base.google.com/ns-metadata/1.0\'/> \n </app:control>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.provider-host.com/123456789\'/>\n <g:label>Computer</g:label>\n <g:label>Laptop</g:label>\n <g:label>testing laptop</g:label>\n <g:item_type>products</g:item_type>\n</entry>' big_feed = '<?xml version="1.0" encoding="utf-8"?>\n <feed xmlns="http://www.w3.org/2005/Atom">\n <title type="text">dive into mark</title>\n <subtitle type="html">\n A &lt;em&gt;lot&lt;/em&gt; of effort\n went into making this effortless\n </subtitle>\n <updated>2005-07-31T12:29:29Z</updated>\n <id>tag:example.org,2003:3</id>\n <link rel="alternate" type="text/html"\n hreflang="en" href="http://example.org/"/>\n <link rel="self" type="application/atom+xml"\n href="http://example.org/feed.atom"/>\n <rights>Copyright (c) 2003, Mark Pilgrim</rights>\n <generator uri="http://www.example.com/" version="1.0">\n Example Toolkit\n </generator>\n <entry>\n <title>Atom draft-07 snapshot</title>\n <link rel="alternate" type="text/html"\n href="http://example.org/2005/04/02/atom"/>\n <link rel="enclosure" type="audio/mpeg" length="1337"\n href="http://example.org/audio/ph34r_my_podcast.mp3"/>\n <id>tag:example.org,2003:3.2397</id>\n <updated>2005-07-31T12:29:29Z</updated>\n <published>2003-12-13T08:29:29-04:00</published>\n <author>\n <name>Mark Pilgrim</name>\n <uri>http://example.org/</uri>\n <email>f8dy@example.com</email>\n </author>\n <contributor>\n <name>Sam Ruby</name>\n </contributor>\n <contributor>\n <name>Joe Gregorio</name>\n </contributor>\n <content type="xhtml" xml:lang="en"\n xml:base="http://diveintomark.org/">\n <div xmlns="http://www.w3.org/1999/xhtml">\n <p><i>[Update: The Atom draft is finished.]</i></p>\n </div>\n </content>\n </entry>\n </feed>\n' small_feed = '<?xml version="1.0" encoding="utf-8"?>\n <feed xmlns="http://www.w3.org/2005/Atom">\n <title>Example Feed</title>\n <link href="http://example.org/"/>\n <updated>2003-12-13T18:30:02Z</updated>\n <author>\n <name>John Doe</name>\n </author>\n <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>\n <entry>\n <title>Atom-Powered Robots Run Amok</title>\n <link href="http://example.org/2003/12/13/atom03"/>\n <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>\n <updated>2003-12-13T18:30:02Z</updated>\n <summary>Some text.</summary>\n </entry>\n </feed>\n' gbase_feed = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:g='http://base.google.com/ns/1.0' xmlns:batch='http://schemas.google.com/gdata/batch'>\n<id>http://www.google.com/base/feeds/snippets</id>\n<updated>2007-02-08T23:18:21.935Z</updated>\n<title type='text'>Items matching query: digital camera</title>\n<link rel='alternate' type='text/html' href='http://base.google.com'>\n</link>\n<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets'>\n</link>\n<link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets?start-index=1&amp;max-results=25&amp;bq=digital+camera'>\n</link>\n<link rel='next' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets?start-index=26&amp;max-results=25&amp;bq=digital+camera'>\n</link>\n<generator version='1.0' uri='http://base.google.com'>GoogleBase </generator>\n<openSearch:totalResults>2171885</openSearch:totalResults>\n<openSearch:startIndex>1</openSearch:startIndex>\n<openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n<entry>\n<id>http://www.google.com/base/feeds/snippets/13246453826751927533</id>\n<published>2007-02-08T13:23:27.000Z</published>\n<updated>2007-02-08T16:40:57.000Z</updated>\n<category scheme='http://base.google.com/categories/itemtypes' term='Products'>\n</category>\n<title type='text'>Digital Camera Battery Notebook Computer 12v DC Power Cable - 5.5mm x 2.5mm (Center +) Camera Connecting Cables</title>\n<content type='html'>Notebook Computer 12v DC Power Cable - 5.5mm x 2.1mm (Center +) This connection cable will allow any Digital Pursuits battery pack to power portable computers that operate with 12v power and have a 2.1mm power connector (center +) Digital ...</content>\n<link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305668&amp;is=REG&amp;kw=DIDCB5092&amp;BI=583'>\n</link>\n<link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/13246453826751927533'>\n</link>\n<author>\n<name>B&amp;H Photo-Video</name>\n<email>anon-szot0wdsq0at@base.google.com</email>\n</author>\n<g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes>\n<g:condition type='text'>new</g:condition>\n<g:location type='location'>420 9th Ave. 10001</g:location>\n<g:id type='text'>305668-REG</g:id>\n<g:item_type type='text'>Products</g:item_type>\n<g:brand type='text'>Digital Camera Battery</g:brand>\n<g:expiration_date type='dateTime'>2007-03-10T13:23:27.000Z</g:expiration_date>\n<g:customer_id type='int'>1172711</g:customer_id>\n<g:price type='floatUnit'>34.95 usd</g:price>\n<g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type>\n<g:item_language type='text'>EN</g:item_language>\n<g:manufacturer_id type='text'>DCB5092</g:manufacturer_id>\n<g:target_country type='text'>US</g:target_country>\n<g:weight type='float'>1.0</g:weight>\n<g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305668.jpg&amp;dhm=ffffffff84c9a95e&amp;size=6</g:image_link>\n</entry>\n<entry>\n<id>http://www.google.com/base/feeds/snippets/10145771037331858608</id>\n<published>2007-02-08T13:23:27.000Z</published>\n<updated>2007-02-08T16:40:57.000Z</updated>\n<category scheme='http://base.google.com/categories/itemtypes' term='Products'>\n</category>\n<title type='text'>Digital Camera Battery Electronic Device 5v DC Power Cable - 5.5mm x 2.5mm (Center +) Camera Connecting Cables</title>\n<content type='html'>Electronic Device 5v DC Power Cable - 5.5mm x 2.5mm (Center +) This connection cable will allow any Digital Pursuits battery pack to power any electronic device that operates with 5v power and has a 2.5mm power connector (center +) Digital ...</content>\n<link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305656&amp;is=REG&amp;kw=DIDCB5108&amp;BI=583'>\n</link>\n<link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/10145771037331858608'>\n</link>\n<author>\n<name>B&amp;H Photo-Video</name>\n<email>anon-szot0wdsq0at@base.google.com</email>\n</author>\n<g:location type='location'>420 9th Ave. 10001</g:location>\n<g:condition type='text'>new</g:condition>\n<g:weight type='float'>0.18</g:weight>\n<g:target_country type='text'>US</g:target_country>\n<g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type>\n<g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes>\n<g:id type='text'>305656-REG</g:id>\n<g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305656.jpg&amp;dhm=7315bdc8&amp;size=6</g:image_link>\n<g:manufacturer_id type='text'>DCB5108</g:manufacturer_id>\n<g:upc type='text'>838098005108</g:upc>\n<g:price type='floatUnit'>34.95 usd</g:price>\n<g:item_language type='text'>EN</g:item_language>\n<g:brand type='text'>Digital Camera Battery</g:brand>\n<g:customer_id type='int'>1172711</g:customer_id>\n<g:item_type type='text'>Products</g:item_type>\n<g:expiration_date type='dateTime'>2007-03-10T13:23:27.000Z</g:expiration_date>\n</entry>\n<entry>\n<id>http://www.google.com/base/feeds/snippets/3128608193804768644</id>\n<published>2007-02-08T02:21:27.000Z</published>\n<updated>2007-02-08T15:40:13.000Z</updated>\n<category scheme='http://base.google.com/categories/itemtypes' term='Products'>\n</category>\n<title type='text'>Digital Camera Battery Power Cable for Kodak 645 Pro-Back ProBack &amp; DCS-300 Series Camera Connecting Cables</title>\n<content type='html'>Camera Connection Cable - to Power Kodak 645 Pro-Back DCS-300 Series Digital Cameras This connection cable will allow any Digital Pursuits battery pack to power the following digital cameras: Kodak DCS Pro Back 645 DCS-300 series Digital Photography ...</content>\n<link rel='alternate' type='text/html' href='http://www.bhphotovideo.com/bnh/controller/home?O=productlist&amp;A=details&amp;Q=&amp;sku=305685&amp;is=REG&amp;kw=DIDCB6006&amp;BI=583'>\n</link>\n<link rel='self' type='application/atom+xml' href='http://www.google.com/base/feeds/snippets/3128608193804768644'>\n</link>\n<author>\n<name>B&amp;H Photo-Video</name>\n<email>anon-szot0wdsq0at@base.google.com</email>\n</author>\n<g:weight type='float'>0.3</g:weight>\n<g:manufacturer_id type='text'>DCB6006</g:manufacturer_id>\n<g:image_link type='url'>http://base.google.com/base_image?q=http%3A%2F%2Fwww.bhphotovideo.com%2Fimages%2Fitems%2F305685.jpg&amp;dhm=72f0ca0a&amp;size=6</g:image_link>\n<g:location type='location'>420 9th Ave. 10001</g:location>\n<g:payment_notes type='text'>PayPal &amp; Bill Me Later credit available online only.</g:payment_notes>\n<g:item_type type='text'>Products</g:item_type>\n<g:target_country type='text'>US</g:target_country>\n<g:accessory_for type='text'>digital kodak camera</g:accessory_for>\n<g:brand type='text'>Digital Camera Battery</g:brand>\n<g:expiration_date type='dateTime'>2007-03-10T02:21:27.000Z</g:expiration_date>\n<g:item_language type='text'>EN</g:item_language>\n<g:condition type='text'>new</g:condition>\n<g:price type='floatUnit'>34.95 usd</g:price>\n<g:customer_id type='int'>1172711</g:customer_id>\n<g:product_type type='text'>Digital Photography&gt;Camera Connecting Cables</g:product_type>\n<g:id type='text'>305685-REG</g:id>\n</entry>\n</feed>" extension_tree = '<?xml version="1.0" encoding="utf-8"?>\n <feed xmlns="http://www.w3.org/2005/Atom">\n <g:author xmlns:g="http://www.google.com">\n <g:name>John Doe\n <g:foo yes="no" up="down">Bar</g:foo>\n </g:name>\n </g:author>\n </feed>\n' test_author = '<?xml version="1.0" encoding="utf-8"?>\n <author xmlns="http://www.w3.org/2005/Atom">\n <name xmlns="http://www.w3.org/2005/Atom">John Doe</name>\n <email xmlns="http://www.w3.org/2005/Atom">johndoes@someemailadress.com</email>\n <uri xmlns="http://www.w3.org/2005/Atom">http://www.google.com</uri>\n </author>\n' test_link = '<?xml version="1.0" encoding="utf-8"?>\n <link xmlns="http://www.w3.org/2005/Atom" href="http://www.google.com" \n rel="test rel" foo1="bar" foo2="rab"/>\n' test_gbase_attribute = '<?xml version="1.0" encoding="utf-8"?>\n <g:brand type=\'text\' xmlns:g="http://base.google.com/ns/1.0">Digital Camera Battery</g:brand>\n' calendar_feed = "<?xml version='1.0' encoding='utf-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom'\nxmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'\nxmlns:gd='http://schemas.google.com/g/2005'\nxmlns:gCal='http://schemas.google.com/gCal/2005'>\n <id>http://www.google.com/calendar/feeds/default</id>\n <updated>2007-03-20T22:48:57.833Z</updated>\n <title type='text'>GData Ops Demo's Calendar List</title>\n <link rel='http://schemas.google.com/g/2005#feed'\n type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default'></link>\n <link rel='http://schemas.google.com/g/2005#post'\n type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default'></link>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default'></link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <generator version='1.0' uri='http://www.google.com/calendar'>\n Google Calendar</generator>\n <openSearch:startIndex>1</openSearch:startIndex>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com</id>\n <published>2007-03-20T22:48:57.837Z</published>\n <updated>2007-03-20T22:48:52.000Z</updated>\n <title type='text'>GData Ops Demo</title>\n <link rel='alternate' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/gdata.ops.demo%40gmail.com/private/full'>\n </link>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:color value='#2952A3'></gCal:color>\n <gCal:accesslevel value='owner'></gCal:accesslevel>\n <gCal:hidden value='false'></gCal:hidden>\n <gCal:timezone value='America/Los_Angeles'></gCal:timezone>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com</id>\n <published>2007-03-20T22:48:57.837Z</published>\n <updated>2007-03-20T22:48:53.000Z</updated>\n <title type='text'>GData Ops Demo Secondary Calendar</title>\n <summary type='text'></summary>\n <link rel='alternate' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com/private/full'>\n </link>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default/jnh21ovnjgfph21h32gvms2758%40group.calendar.google.com'>\n </link>\n <author>\n <name>GData Ops Demo Secondary Calendar</name>\n </author>\n <gCal:color value='#528800'></gCal:color>\n <gCal:accesslevel value='owner'></gCal:accesslevel>\n <gCal:hidden value='false'></gCal:hidden>\n <gCal:timezone value='America/Los_Angeles'></gCal:timezone>\n <gd:where valueString=''></gd:where>\n </entry>\n</feed>\n" calendar_full_event_feed = '<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<feed xmlns=\'http://www.w3.org/2005/Atom\'\nxmlns:openSearch=\'http://a9.com/-/spec/opensearchrss/1.0/\'\nxmlns:gd=\'http://schemas.google.com/g/2005\'\nxmlns:gCal=\'http://schemas.google.com/gCal/2005\'>\n <id>\n http://www.google.com/calendar/feeds/default/private/full</id>\n <updated>2007-03-20T21:29:57.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>GData Ops Demo</title>\n <subtitle type=\'text\'>GData Ops Demo</subtitle>\n <link rel=\'http://schemas.google.com/g/2005#feed\'\n type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full\'>\n </link>\n <link rel=\'http://schemas.google.com/g/2005#post\'\n type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full\'>\n </link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full?updated-min=2001-01-01&amp;max-results=25\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <generator version=\'1.0\' uri=\'http://www.google.com/calendar\'>\n Google Calendar</generator>\n <openSearch:totalResults>10</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <gCal:timezone value=\'America/Los_Angeles\'></gCal:timezone>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100</id>\n <published>2007-03-20T21:29:52.000Z</published>\n <updated>2007-03-20T21:29:57.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>test deleted</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=bzk5ZmxtZ21rZmtmcnI4dTc0NWdocjMxMDAgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/63310109397\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.canceled\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-23T12:00:00.000-07:00\'\n endTime=\'2007-03-23T13:00:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0</id>\n <published>2007-03-20T21:26:04.000Z</published>\n <updated>2007-03-20T21:28:46.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Afternoon at Dolores Park with Kim</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=MnF0M2FvNWhiYXE3bTlpZ3I1YWs5ZXNqbzAgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/63310109326\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.private\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:who rel=\'http://schemas.google.com/g/2005#event.organizer\'\n valueString=\'GData Ops Demo\' email=\'gdata.ops.demo@gmail.com\'>\n <gd:attendeeStatus value=\'http://schemas.google.com/g/2005#event.accepted\'>\n </gd:attendeeStatus>\n </gd:who>\n <gd:who rel=\'http://schemas.google.com/g/2005#event.attendee\'\n valueString=\'Ryan Boyd (API)\' email=\'api.rboyd@gmail.com\'>\n <gd:attendeeStatus value=\'http://schemas.google.com/g/2005#event.invited\'>\n </gd:attendeeStatus>\n </gd:who>\n <gd:when startTime=\'2007-03-24T12:00:00.000-07:00\'\n endTime=\'2007-03-24T15:00:00.000-07:00\'>\n <gd:reminder minutes=\'20\'></gd:reminder>\n </gd:when>\n <gd:where valueString=\'Dolores Park with Kim\'></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos</id>\n <published>2007-03-20T21:28:37.000Z</published>\n <updated>2007-03-20T21:28:37.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Team meeting</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=dXZzcWhnN2tsbmFlNDB2NTB2aWhyMXB2b3NfMjAwNzAzMjNUMTYwMDAwWiBnZGF0YS5vcHMuZGVtb0Bt\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos/63310109317\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gd:recurrence>DTSTART;TZID=America/Los_Angeles:20070323T090000\n DTEND;TZID=America/Los_Angeles:20070323T100000\n RRULE:FREQ=WEEKLY;BYDAY=FR;UNTIL=20070817T160000Z;WKST=SU\n BEGIN:VTIMEZONE TZID:America/Los_Angeles\n X-LIC-LOCATION:America/Los_Angeles BEGIN:STANDARD\n TZOFFSETFROM:-0700 TZOFFSETTO:-0800 TZNAME:PST\n DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0800 TZOFFSETTO:-0700\n TZNAME:PDT DTSTART:19700405T020000\n RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT\n END:VTIMEZONE</gd:recurrence>\n <gCal:sendEventNotifications value=\'true\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.public\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:reminder minutes=\'10\'></gd:reminder>\n <gd:where valueString=\'\'></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo</id>\n <published>2007-03-20T21:25:46.000Z</published>\n <updated>2007-03-20T21:25:46.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Movie with Kim and danah</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=c3Q0dms5a2lmZnM2cmFzcmwzMmU0YTdhbG8gZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/63310109146\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-24T20:00:00.000-07:00\'\n endTime=\'2007-03-24T21:00:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo</id>\n <published>2007-03-20T21:24:43.000Z</published>\n <updated>2007-03-20T21:25:08.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Dinner with Kim and Sarah</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=b2ZsMWU0NXVidHNvaDZndHUxMjdjbHMyb28gZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/63310109108\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-20T19:00:00.000-07:00\'\n endTime=\'2007-03-20T21:30:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g</id>\n <published>2007-03-20T21:24:19.000Z</published>\n <updated>2007-03-20T21:25:05.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Dinner with Jane and John</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=YjY5czJhdmZpMmpvaWdzY2xlY3ZqbGM5MWcgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/63310109105\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-22T17:00:00.000-07:00\'\n endTime=\'2007-03-22T19:30:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc</id>\n <published>2007-03-20T21:24:33.000Z</published>\n <updated>2007-03-20T21:24:33.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Tennis with Elizabeth</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=dTlwNjZra2lvdG44YnFoOWs3ajRyY25qamMgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/63310109073\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-24T10:00:00.000-07:00\'\n endTime=\'2007-03-24T11:00:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c</id>\n <published>2007-03-20T21:24:00.000Z</published>\n <updated>2007-03-20T21:24:00.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>Lunch with Jenn</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=NzZvajJrY2VpZG9iM3M3MDh0dmZudWFxM2MgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/63310109040\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-03-20T11:30:00.000-07:00\'\n endTime=\'2007-03-20T12:30:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco</id>\n <published>2007-03-20T07:50:02.000Z</published>\n <updated>2007-03-20T20:39:26.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>test entry</title>\n <content type=\'text\'>test desc</content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=NW5wOWVjOG03dW9hdWsxdmVkaDVtaG9kY28gZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/63310106366\'>\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.private\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:who rel=\'http://schemas.google.com/g/2005#event.attendee\'\n valueString=\'Vivian Li\' email=\'vli@google.com\'>\n <gd:attendeeStatus value=\'http://schemas.google.com/g/2005#event.declined\'>\n </gd:attendeeStatus>\n </gd:who>\n <gd:who rel=\'http://schemas.google.com/g/2005#event.organizer\'\n valueString=\'GData Ops Demo\' email=\'gdata.ops.demo@gmail.com\'>\n <gd:attendeeStatus value=\'http://schemas.google.com/g/2005#event.accepted\'>\n </gd:attendeeStatus>\n </gd:who>\n <gd:when startTime=\'2007-03-21T08:00:00.000-07:00\'\n endTime=\'2007-03-21T09:00:00.000-07:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where valueString=\'anywhere\'></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg</id>\n <published>2007-02-14T23:23:37.000Z</published>\n <updated>2007-02-14T23:25:30.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\'></category>\n <title type=\'text\'>test</title>\n <content type=\'text\'></content>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=ZnU2c2wwcnFha2YzbzBhMTNvbzFpMWExbWcgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\'></link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg\'>\n </link>\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/63307178730\'>\n </link>\n <link rel="http://schemas.google.com/gCal/2005/webContent" title="World Cup" href="http://www.google.com/calendar/images/google-holiday.gif" type="image/gif">\n <gCal:webContent width="276" height="120" url="http://www.google.com/logos/worldcup06.gif" />\n </link>\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/comments\'>\n </gd:feedLink>\n </gd:comments>\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\'>\n </gd:visibility>\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\'>\n </gd:transparency>\n <gd:when startTime=\'2007-02-15T08:30:00.000-08:00\'\n endTime=\'2007-02-15T09:30:00.000-08:00\'>\n <gd:reminder minutes=\'10\'></gd:reminder>\n </gd:when>\n <gd:where></gd:where>\n </entry>\n <entry>\n <id>\n http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc</id>\n <published>2007-07-16T22:13:28.000Z</published>\n <updated>2007-07-16T22:13:29.000Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/g/2005#event\' />\n <title type=\'text\'></title>\n <content type=\'text\' />\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.google.com/calendar/event?eid=aDdhMGhhYTRkYThzaWwzcnIxOWlhNmx1dmMgZ2RhdGEub3BzLmRlbW9AbQ\'\n title=\'alternate\' />\n <link rel=\'http://schemas.google.com/gCal/2005/webContent\'\n type=\'application/x-google-gadgets+xml\'\n href=\'http://gdata.ops.demo.googlepages.com/birthdayicon.gif\'\n title=\'Date and Time Gadget\'>\n <gCal:webContent width=\'300\' height=\'136\'\n url=\'http://google.com/ig/modules/datetime.xml\'>\n <gCal:webContentGadgetPref name=\'color\' value=\'green\' />\n </gCal:webContent>\n </link>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc\' />\n <link rel=\'edit\' type=\'application/atom+xml\'\n href=\'http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc/63320307209\' />\n <author>\n <name>GData Ops Demo</name>\n <email>gdata.ops.demo@gmail.com</email>\n </author>\n <gd:comments>\n <gd:feedLink href=\'http://www.google.com/calendar/feeds/default/private/full/h7a0haa4da8sil3rr19ia6luvc/comments\' />\n </gd:comments>\n <gCal:sendEventNotifications value=\'false\'>\n </gCal:sendEventNotifications>\n <gd:eventStatus value=\'http://schemas.google.com/g/2005#event.confirmed\' />\n <gd:visibility value=\'http://schemas.google.com/g/2005#event.default\' />\n <gd:transparency value=\'http://schemas.google.com/g/2005#event.opaque\' />\n <gd:when startTime=\'2007-03-14\' endTime=\'2007-03-15\' />\n <gd:where />\n </entry>\n</feed>\n' calendar_batch_request = "<?xml version='1.0' encoding='utf-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom' \n xmlns:batch='http://schemas.google.com/gdata/batch'\n xmlns:gCal='http://schemas.google.com/gCal/2005'>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <entry>\n <batch:id>1</batch:id>\n <batch:operation type='insert' />\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event inserted via batch</title>\n </entry>\n <entry>\n <batch:id>2</batch:id>\n <batch:operation type='query' />\n <id>http://www.google.com/calendar/feeds/default/private/full/glcs0kv2qqa0gf52qi1jo018gc</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event queried via batch</title>\n </entry>\n <entry>\n <batch:id>3</batch:id>\n <batch:operation type='update' />\n <id>http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event updated via batch</title>\n <link rel='alternate' type='text/html' \n href='http://www.google.com/calendar/event?eid=dWptMGdvNWR0bmdka3I2dTkxZGNxdmowcXMgaGFyaXNodi50ZXN0QG0' title='alternate' />\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs' />\n <link rel='edit' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs/63326098791' />\n </entry>\n <entry>\n <batch:id>4</batch:id>\n <batch:operation type='delete' />\n <id>http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event deleted via batch</title>\n <link rel='alternate' type='text/html' \n href='http://www.google.com/calendar/event?eid=ZDhxYmc5ZWdrMW42bGhzZ3Exc2picWZmcWMgaGFyaXNodi50ZXN0QG0' title='alternate' />\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc' />\n <link rel='edit' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc/63326018324' />\n </entry>\n</feed>\n" calendar_batch_response = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom' \n xmlns:batch='http://schemas.google.com/gdata/batch'\n xmlns:gCal='http://schemas.google.com/gCal/2005'>\n <id>http://www.google.com/calendar/feeds/default/private/full</id>\n <updated>2007-09-21T23:01:00.380Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>Batch Feed</title>\n <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full' />\n <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full' />\n <link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/batch' />\n <entry>\n <batch:id>1</batch:id>\n <batch:status code='201' reason='Created' />\n <batch:operation type='insert' />\n <id>http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event inserted via batch</title>\n <link rel='alternate' type='text/html' \n href='http://www.google.com/calendar/event?eid=bjl1Zzc4Z2Q5dHY1M3BwbjRoZGp2azY4ZWsgaGFyaXNodi50ZXN0QG0' title='alternate' />\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek' />\n <link rel='edit' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/n9ug78gd9tv53ppn4hdjvk68ek/63326098860' />\n </entry>\n <entry>\n <batch:id>2</batch:id>\n <batch:status code='200' reason='Success' />\n <batch:operation type='query' />\n <id>http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event queried via batch</title>\n <link rel='alternate' type='text/html' \n href='http://www.google.com/calendar/event?eid=Z2xzYzBrdjJhcWEwZmY1MnFpMWpvMDE4Z2MgaGFyaXNodi50ZXN0QG0' title='alternate' />\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc' />\n <link rel='edit' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/glsc0kv2aqa0ff52qi1jo018gc/63326098791' />\n </entry>\n <entry xmlns:gCal='http://schemas.google.com/gCal/2005'>\n <batch:id>3</batch:id>\n <batch:status code='200' reason='Success' />\n <batch:operation type='update' />\n <id>http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event updated via batch</title>\n <link rel='alternate' type='text/html' \n href='http://www.google.com/calendar/event?eid=dWptMGdvNWR0bmdka3I2dTkxZGNxdmowcXMgaGFyaXNodi50ZXN0QG0' title='alternate' />\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs' />\n <link rel='edit' type='application/atom+xml' \n href='http://www.google.com/calendar/feeds/default/private/full/ujm0go5dtngdkr6u91dcqvj0qs/63326098860' />\n <batch:id>3</batch:id>\n <batch:status code='200' reason='Success' />\n <batch:operation type='update' />\n </entry>\n <entry>\n <batch:id>4</batch:id>\n <batch:status code='200' reason='Success' />\n <batch:operation type='delete' />\n <id>http://www.google.com/calendar/feeds/default/private/full/d8qbg9egk1n6lhsgq1sjbqffqc</id>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event' />\n <title type='text'>Event deleted via batch</title>\n <content type='text'>Deleted</content>\n </entry>\n</feed>\n" gbase_attribute_feed = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n <feed xmlns=\'http://www.w3.org/2005/Atom\' xmlns:openSearch=\'http://a9.com/-/spec/opensearchrss/1.0/\' xmlns:gm=\'http://base.google.com/ns-metadata/1.0\'>\n <id>http://www.google.com/base/feeds/attributes</id>\n <updated>2006-11-01T20:35:59.578Z</updated>\n <category scheme=\'http://base.google.com/categories/itemtypes\' term=\'online jobs\'></category>\n <category scheme=\'http://base.google.com/categories/itemtypes\' term=\'jobs\'></category>\n <title type=\'text\'>Attribute histogram for query: [item type:jobs]</title>\n <link rel=\'alternate\' type=\'text/html\' href=\'http://base.google.com\'></link>\n <link rel=\'http://schemas.google.com/g/2005#feed\' type=\'application/atom+xml\' href=\'http://www.google.com/base/feeds\n/attributes\'></link>\n <link rel=\'self\' type=\'application/atom+xml\' href=\'http://www.google.com/base/feeds/attributes/-/jobs\'></link>\n <generator version=\'1.0\' uri=\'http://base.google.com\'>GoogleBase</generator>\n <openSearch:totalResults>16</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>16</openSearch:itemsPerPage>\n <entry>\n <id>http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D</id>\n <updated>2006-11-01T20:36:00.100Z</updated>\n <title type=\'text\'>job industry(text)</title>\n <content type=\'text\'>Attribute"job industry" of type text.\n </content>\n <link rel=\'self\' type=\'application/atom+xml\' href=\'http://www.google.com/base/feeds/attributes/job+industry%28text\n%29N%5Bitem+type%3Ajobs%5D\'></link>\n <gm:attribute name=\'job industry\' type=\'text\' count=\'4416629\'>\n <gm:value count=\'380772\'>it internet</gm:value>\n <gm:value count=\'261565\'>healthcare</gm:value>\n <gm:value count=\'142018\'>information technology</gm:value>\n <gm:value count=\'124622\'>accounting</gm:value>\n <gm:value count=\'111311\'>clerical and administrative</gm:value>\n <gm:value count=\'82928\'>other</gm:value>\n <gm:value count=\'77620\'>sales and sales management</gm:value>\n <gm:value count=\'68764\'>information systems</gm:value>\n <gm:value count=\'65859\'>engineering and architecture</gm:value>\n <gm:value count=\'64757\'>sales</gm:value>\n </gm:attribute>\n </entry>\n </feed>\n' gbase_attribute_entry = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n <entry xmlns=\'http://www.w3.org/2005/Atom\' xmlns:openSearch=\'http://a9.com/-/spec/opensearchrss/1.0/\' xmlns:gm=\'http://base.google.com/ns-metadata/1.0\'>\n <id>http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D</id>\n <updated>2006-11-01T20:36:00.100Z</updated>\n <title type=\'text\'>job industry(text)</title>\n <content type=\'text\'>Attribute"job industry" of type text.\n </content>\n <link rel=\'self\' type=\'application/atom+xml\' href=\'http://www.google.com/base/feeds/attributes/job+industry%28text%29N%5Bitem+type%3Ajobs%5D\'></link>\n <gm:attribute name=\'job industry\' type=\'text\' count=\'4416629\'>\n <gm:value count=\'380772\'>it internet</gm:value>\n <gm:value count=\'261565\'>healthcare</gm:value>\n <gm:value count=\'142018\'>information technology</gm:value>\n <gm:value count=\'124622\'>accounting</gm:value>\n <gm:value count=\'111311\'>clerical and administrative</gm:value>\n <gm:value count=\'82928\'>other</gm:value>\n <gm:value count=\'77620\'>sales and sales management</gm:value>\n <gm:value count=\'68764\'>information systems</gm:value>\n <gm:value count=\'65859\'>engineering and architecture</gm:value>\n <gm:value count=\'64757\'>sales</gm:value>\n </gm:attribute>\n </entry>\n' gbase_locales_feed = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<feed xmlns=\'http://www.w3.org/2005/Atom\'\n xmlns:openSearch=\'http://a9.com/-/spec/opensearchrss/1.0/\'\n xmlns:gm=\'http://base.google.com/ns-metadata/1.0\'>\n <id> http://www.google.com/base/feeds/locales/</id>\n <updated>2006-06-13T18:11:40.120Z</updated>\n <title type="text">Locales</title> \n <link rel="alternate" type="text/html" href="http://base.google.com"/>\n <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"\n\n href="http://www.google.com/base/feeds/locales/"/>\n <link rel="self" type="application/atom+xml" href="http://www.google.com/base/feeds/locales/"/>\n <author>\n <name>Google Inc.</name>\n <email>base@google.com</email>\n </author>\n <generator version="1.0" uri="http://base.google.com">GoogleBase</generator>\n <openSearch:totalResults>3</openSearch:totalResults>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n\n<entry>\n <id>http://www.google.com/base/feeds/locales/en_US</id>\n <updated>2006-03-27T22:27:36.658Z</updated>\n <category scheme="http://base.google.com/categories/locales" term="en_US"/>\n\n <title type="text">en_US</title>\n <content type="text">en_US</content>\n <link rel="self" type="application/atom+xml" \n href="http://www.google.com/base/feeds/locales/en_US"></link>\n\n <link rel="related" type="application/atom+xml" \n href="http://www.google.com/base/feeds/itemtypes/en_US" title="Item types in en_US"/>\n</entry>\n<entry>\n <id>http://www.google.com/base/feeds/locales/en_GB</id>\n <updated>2006-06-13T18:14:18.601Z</updated>\n <category scheme="http://base.google.com/categories/locales" term="en_GB"/>\n <title type="text">en_GB</title>\n <content type="text">en_GB</content>\n <link rel="related" type="application/atom+xml" \n href="http://www.google.com/base/feeds/itemtypes/en_GB" title="Item types in en_GB"/>\n <link rel="self" type="application/atom+xml" \n href="http://www.google.com/base/feeds/locales/en_GB"/>\n</entry>\n<entry>\n <id>http://www.google.com/base/feeds/locales/de_DE</id>\n <updated>2006-06-13T18:14:18.601Z</updated>\n <category scheme="http://base.google.com/categories/locales" term="de_DE"/>\n <title type="text">de_DE</title>\n <content type="text">de_DE</content>\n <link rel="related" type="application/atom+xml" \n href="http://www.google.com/base/feeds/itemtypes/de_DE" title="Item types in de_DE"/>\n <link rel="self" type="application/atom+xml" \n href="http://www.google.com/base/feeds/locales/de_DE"/>\n</entry>\n</feed>' gbase_string_encoding_entry = "<?xml version='1.0' encoding='UTF-8'?>\n<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gm='http://base.google.com/ns-metadata/1.0' \n xmlns:g='http://base.google.com/ns/1.0' xmlns:batch='http://schemas.google.com/gdata/batch'>\n <id>http://www.google.com/base/feeds/snippets/17495780256183230088</id>\n <published>2007-12-09T03:13:07.000Z</published>\n <updated>2008-01-07T03:26:46.000Z</updated>\n <category scheme='http://base.google.com/categories/itemtypes' term='Products'/>\n <title type='text'>Digital Camera Cord Fits SONY Cybershot DSC-R1 S40</title>\n <content type='html'>SONY · Cybershot Digital Camera Usb Cable DESCRIPTION \n This is a 2.5 USB 2.0 A to Mini B (5 Pin) high quality digital camera \n cable used for connecting your Sony Digital Cameras and Camcoders. Backward \n Compatible with USB 2.0, 1.0 and 1.1. Fully ...</content>\n <link rel='alternate' type='text/html' \n href='http://adfarm.mediaplex.com/ad/ck/711-5256-8196-2?loc=http%3A%2F%2Fcgi.ebay.com%2FDigital-Camera-Cord-Fits-SONY-Cybershot-DSC-R1-S40_W0QQitemZ270195049057QQcmdZViewItem'/>\n <link rel='self' type='application/atom+xml' \n href='http://www.google.com/base/feeds/snippets/17495780256183230088'/>\n <author>\n <name>eBay</name>\n </author>\n <g:item_type type='text'>Products</g:item_type>\n <g:item_language type='text'>EN</g:item_language>\n <g:target_country type='text'>US</g:target_country>\n <g:price type='floatUnit'>0.99 usd</g:price>\n <g:image_link type='url'>http://thumbs.ebaystatic.com/pict/270195049057_1.jpg</g:image_link>\n <g:category type='text'>Cameras &amp; Photo&gt;Digital Camera Accessories&gt;Cables</g:category>\n <g:category type='text'>Cords &amp; Connectors&gt;USB Cables&gt;For Other Brands</g:category>\n <g:customer_id type='int'>11729</g:customer_id>\n <g:id type='text'>270195049057</g:id>\n <g:expiration_date type='dateTime'>2008-02-06T03:26:46Z</g:expiration_date>\n</entry>" recurrence_exception_entry = "<entry xmlns='http://www.w3.org/2005/Atom'\nxmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'\nxmlns:gd='http://schemas.google.com/g/2005'\nxmlns:gCal='http://schemas.google.com/gCal/2005'>\n <id>\n http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g</id>\n <published>2007-04-05T21:51:49.000Z</published>\n <updated>2007-04-05T21:51:49.000Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>testDavid</title>\n <content type='text'></content>\n <link rel='alternate' type='text/html'\n href='http://www.google.com/calendar/event?eid=aTdsZ2ZqNjltanFqZ25vZGtsaWYzdmJtN2dfMjAwNzA0MDNUMTgwMDAwWiBnZGF0YS5vcHMudGVzdEBt'\n title='alternate'></link>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g'>\n </link>\n <author>\n <name>gdata ops</name>\n <email>gdata.ops.test@gmail.com</email>\n </author>\n <gd:visibility value='http://schemas.google.com/g/2005#event.default'>\n </gd:visibility>\n <gCal:sendEventNotifications value='true'>\n </gCal:sendEventNotifications>\n <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'>\n </gd:eventStatus>\n <gd:recurrence>DTSTART;TZID=America/Anchorage:20070403T100000\n DTEND;TZID=America/Anchorage:20070403T110000\n RRULE:FREQ=DAILY;UNTIL=20070408T180000Z;WKST=SU\n EXDATE;TZID=America/Anchorage:20070407T100000\n EXDATE;TZID=America/Anchorage:20070405T100000\n EXDATE;TZID=America/Anchorage:20070404T100000 BEGIN:VTIMEZONE\n TZID:America/Anchorage X-LIC-LOCATION:America/Anchorage\n BEGIN:STANDARD TZOFFSETFROM:-0800 TZOFFSETTO:-0900 TZNAME:AKST\n DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0900 TZOFFSETTO:-0800\n TZNAME:AKDT DTSTART:19700405T020000\n RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT\n END:VTIMEZONE</gd:recurrence>\n <gd:where valueString=''></gd:where>\n <gd:reminder minutes='10'></gd:reminder>\n <gd:recurrenceException specialized='true'>\n <gd:entryLink>\n <entry>\n <id>i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z</id>\n <published>2007-04-05T21:51:49.000Z</published>\n <updated>2007-04-05T21:52:58.000Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>testDavid</title>\n <content type='text'></content>\n <link rel='alternate' type='text/html'\n href='http://www.google.com/calendar/event?eid=aTdsZ2ZqNjltanFqZ25vZGtsaWYzdmJtN2dfMjAwNzA0MDdUMTgwMDAwWiBnZGF0YS5vcHMudGVzdEBt'\n title='alternate'></link>\n <author>\n <name>gdata ops</name>\n <email>gdata.ops.test@gmail.com</email>\n </author>\n <gd:visibility value='http://schemas.google.com/g/2005#event.default'>\n </gd:visibility>\n <gd:originalEvent id='i7lgfj69mjqjgnodklif3vbm7g'\n href='http://www.google.com/calendar/feeds/default/private/composite/i7lgfj69mjqjgnodklif3vbm7g'>\n\n <gd:when startTime='2007-04-07T13:00:00.000-05:00'>\n </gd:when>\n </gd:originalEvent>\n <gCal:sendEventNotifications value='false'>\n </gCal:sendEventNotifications>\n <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus value='http://schemas.google.com/g/2005#event.canceled'>\n </gd:eventStatus>\n <gd:comments>\n <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z/comments'>\n\n <feed>\n <updated>2007-04-05T21:54:09.285Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/g/2005#message'>\n </category>\n <title type='text'>Comments for: testDavid</title>\n <link rel='alternate' type='text/html'\n href='http://www.google.com/calendar/feeds/default/private/full/i7lgfj69mjqjgnodklif3vbm7g_20070407T180000Z/comments'\n title='alternate'></link>\n </feed>\n </gd:feedLink>\n </gd:comments>\n <gd:when startTime='2007-04-07T13:00:00.000-05:00'\n endTime='2007-04-07T14:00:00.000-05:00'>\n <gd:reminder minutes='10'></gd:reminder>\n </gd:when>\n <gd:where valueString=''></gd:where>\n </entry>\n </gd:entryLink>\n </gd:recurrenceException>\n </entry>" nick_entry = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"\n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>https://www.google.com/a/feeds/example.com/nickname/2.0/Foo</atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#nickname\'/>\n <atom:title type="text">Foo</atom:title>\n <atom:link rel="self" type="application/atom+xml"\n href="https://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="https://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/>\n <apps:nickname name="Foo"/>\n <apps:login userName="TestUser"/>\n</atom:entry>' nick_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:feed xmlns:atom="http://www.w3.org/2005/Atom"\n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:apps="http://schemas.google.com/apps/2006">\n <atom:id>\n http://www.google.com/a/feeds/example.com/nickname/2.0\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#nickname\'/>\n <atom:title type="text">Nicknames for user SusanJones</atom:title>\n <atom:link rel=\'http://schemas.google.com/g/2005#feed\'\n type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#post\'\n type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0"/>\n <atom:link rel="self" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=TestUser"/>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>2</openSearch:itemsPerPage>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/nickname/2.0/Foo\n </atom:id>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#nickname\'/>\n <atom:title type="text">Foo</atom:title>\n <atom:link rel="self" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0/Foo"/>\n <apps:nickname name="Foo"/>\n <apps:login userName="TestUser"/>\n </atom:entry>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/nickname/2.0/suse\n </atom:id>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#nickname\'/>\n <atom:title type="text">suse</atom:title>\n <atom:link rel="self" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0/Bar"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/nickname/2.0/Bar"/>\n <apps:nickname name="Bar"/>\n <apps:login userName="TestUser"/>\n </atom:entry>\n</atom:feed>' user_entry = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"\n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>https://www.google.com/a/feeds/example.com/user/2.0/TestUser</atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#user\'/>\n <atom:title type="text">TestUser</atom:title>\n <atom:link rel="self" type="application/atom+xml"\n href="https://www.google.com/a/feeds/example.com/user/2.0/TestUser"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="https://www.google.com/a/feeds/example.com/user/2.0/TestUser"/>\n <apps:login userName="TestUser" password="password" suspended="false"\n ipWhitelisted=\'false\' hashFunctionName="SHA-1"/>\n <apps:name familyName="Test" givenName="User"/>\n <apps:quota limit="1024"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.nicknames\'\n href="https://www.google.com/a/feeds/example.com/nickname/2.0?username=Test-3121"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.emailLists\'\n href="https://www.google.com/a/feeds/example.com/emailList/2.0?recipient=testlist@example.com"/>\n</atom:entry>' user_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" \n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>\n http://www.google.com/a/feeds/example.com/user/2.0\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\' \n term=\'http://schemas.google.com/apps/2006#user\'/>\n <atom:title type="text">Users</atom:title>\n <atom:link rel="next" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/user/2.0?startUsername=john"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#feed\' \n type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/user/2.0"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#post\'\n type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/user/2.0"/>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/user/2.0"/>\n <openSearch:startIndex>1</openSearch:startIndex>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/user/2.0/TestUser\n </atom:id>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#user\'/>\n <atom:title type="text">TestUser</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/user/2.0/TestUser"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/user/2.0/TestUser"/>\n <gd:who rel=\'http://schemas.google.com/apps/2006#user.recipient\' \n email="TestUser@example.com"/>\n <apps:login userName="TestUser" suspended="false"/>\n <apps:quota limit="2048"/>\n <apps:name familyName="Test" givenName="User"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.nicknames\'\n href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=TestUser"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.emailLists\'\n href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=TestUser@example.com"/>\n </atom:entry>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith\n </atom:id>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#user\'/>\n <atom:title type="text">JohnSmith</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/user/2.0/JohnSmith"/>\n <gd:who rel=\'http://schemas.google.com/apps/2006#user.recipient\'\n email="JohnSmith@example.com"/>\n <apps:login userName="JohnSmith" suspended="false"/>\n <apps:quota limit="2048"/>\n <apps:name familyName="Smith" givenName="John"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.nicknames\'\n href="http://www.google.com/a/feeds/example.com/nickname/2.0?username=JohnSmith"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#user.emailLists\'\n href="http://www.google.com/a/feeds/example.com/emailList/2.0?recipient=JohnSmith@example.com"/>\n </atom:entry>\n</atom:feed>' email_list_entry = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"\n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>\n https://www.google.com/a/feeds/example.com/emailList/2.0/testlist\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList\'/>\n <atom:title type="text">testlist</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="https://www.google.com/a/feeds/example.com/emailList/2.0/testlist"/>\n <atom:link rel="edit" type="application/atom+xml" \n href="https://www.google.com/a/feeds/example.com/emailList/2.0/testlist"/>\n <apps:emailList name="testlist"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#emailList.recipients\'\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/testlist/recipient/"/>\n</atom:entry>' email_list_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" \n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList\'/>\n <atom:title type="text">EmailLists</atom:title>\n <atom:link rel="next" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0?startEmailListName=john"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#feed\'\n type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#post\' \n type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0"/>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0"/>\n <openSearch:startIndex>1</openSearch:startIndex>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList\'/>\n <atom:title type="text">us-sales</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales"/>\n <apps:emailList name="us-sales"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#emailList.recipients\'\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/"/>\n </atom:entry>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList\'/>\n <atom:title type="text">us-eng</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng"/>\n <apps:emailList name="us-eng"/>\n <gd:feedLink rel=\'http://schemas.google.com/apps/2006#emailList.recipients\'\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-eng/recipient/"/>\n </atom:entry>\n</atom:feed>' email_list_recipient_entry = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"\n xmlns:apps="http://schemas.google.com/apps/2006"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com</atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList.recipient\'/>\n <atom:title type="text">TestUser</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com"/>\n <atom:link rel="edit" type="application/atom+xml" \n href="https://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/TestUser%40example.com"/>\n <gd:who email="TestUser@example.com"/>\n</atom:entry>' email_list_recipient_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" \n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:gd="http://schemas.google.com/g/2005">\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList.recipient\'/>\n <atom:title type="text">Recipients for email list us-sales</atom:title>\n <atom:link rel="next" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/?startRecipient=terry@example.com"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#feed\'\n type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/>\n <atom:link rel=\'http://schemas.google.com/g/2005#post\'\n type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient"/>\n <openSearch:startIndex>1</openSearch:startIndex>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList.recipient\'/>\n <atom:title type="text">joe@example.com</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/joe%40example.com"/>\n <gd:who email="joe@example.com"/>\n </atom:entry>\n <atom:entry>\n <atom:id>\n http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com\n </atom:id>\n <atom:updated>1970-01-01T00:00:00.000Z</atom:updated>\n <atom:category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://schemas.google.com/apps/2006#emailList.recipient\'/>\n <atom:title type="text">susan@example.com</atom:title>\n <atom:link rel="self" type="application/atom+xml" \n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/>\n <atom:link rel="edit" type="application/atom+xml"\n href="http://www.google.com/a/feeds/example.com/emailList/2.0/us-sales/recipient/susan%40example.com"/>\n <gd:who email="susan@example.com"/>\n </atom:entry>\n</atom:feed>' acl_feed = "<?xml version='1.0' encoding='UTF-8'?>\n <feed xmlns='http://www.w3.org/2005/Atom'\n xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'\n xmlns:gAcl='http://schemas.google.com/acl/2007'>\n <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full</id>\n <updated>2007-04-21T00:52:04.000Z</updated>\n <title type='text'>Elizabeth Bennet's access control list</title>\n <link rel='http://schemas.google.com/acl/2007#controlledObject'\n type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/private/full'>\n </link>\n <link rel='http://schemas.google.com/g/2005#feed'\n type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'>\n </link>\n <link rel='http://schemas.google.com/g/2005#post'\n type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'>\n </link>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full'>\n </link>\n <generator version='1.0'\n uri='http://www.google.com/calendar'>Google Calendar</generator>\n <openSearch:totalResults>2</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <entry>\n <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com</id>\n <updated>2007-04-21T00:52:04.000Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/acl/2007#accessRule'>\n </category>\n <title type='text'>owner</title>\n <content type='text'></content>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'>\n </link>\n <link rel='edit' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'>\n </link>\n <author>\n <name>Elizabeth Bennet</name>\n <email>liz@gmail.com</email>\n </author>\n <gAcl:scope type='user' value='liz@gmail.com'></gAcl:scope>\n <gAcl:role value='http://schemas.google.com/gCal/2005#owner'>\n </gAcl:role>\n </entry>\n <entry>\n <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default</id>\n <updated>2007-04-21T00:52:04.000Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/acl/2007#accessRule'>\n </category>\n <title type='text'>read</title>\n <content type='text'></content>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default'>\n </link>\n <link rel='edit' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default'>\n </link>\n <author>\n <name>Elizabeth Bennet</name>\n <email>liz@gmail.com</email>\n </author>\n <gAcl:scope type='default'></gAcl:scope>\n <gAcl:role value='http://schemas.google.com/gCal/2005#read'>\n </gAcl:role>\n </entry>\n </feed>" acl_entry = "<?xml version='1.0' encoding='UTF-8'?>\n <entry xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gCal='http://schemas.google.com/gCal/2005' xmlns:gAcl='http://schemas.google.com/acl/2007'>\n <id>http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com</id>\n <updated>2007-04-21T00:52:04.000Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/acl/2007#accessRule'>\n </category>\n <title type='text'>owner</title>\n <content type='text'></content>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'>\n </link>\n <link rel='edit' type='application/atom+xml'\n href='http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/user%3Aliz%40gmail.com'>\n </link>\n <author>\n <name>Elizabeth Bennet</name>\n <email>liz@gmail.com</email>\n </author>\n <gAcl:scope type='user' value='liz@gmail.com'></gAcl:scope>\n <gAcl:role value='http://schemas.google.com/gCal/2005#owner'>\n </gAcl:role>\n </entry>" document_list_feed = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<ns0:feed xmlns:ns0="http://www.w3.org/2005/Atom"><ns1:totalResults\nxmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">2</ns1:totalResults><ns1:startIndex\nxmlns:ns1="http://a9.com/-/spec/opensearchrss/1.0/">1</ns1:startIndex><ns0:entry><ns0:content\nsrc="http://foo.com/fm?fmcmd=102&amp;key=supercalifragilisticexpeadocious"\ntype="text/html"\n/><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category\nlabel="spreadsheet" scheme="http://schemas.google.com/g/2005#kind"\nterm="http://schemas.google.com/docs/2007#spreadsheet"\n/><ns0:id>http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpeadocious</ns0:id><ns0:link\nhref="http://foo.com/ccc?key=supercalifragilisticexpeadocious" rel="alternate"\ntype="text/html" /><ns0:link\nhref="http://foo.com/feeds/worksheets/supercalifragilisticexpeadocious/private/full"\nrel="http://schemas.google.com/spreadsheets/2006#worksheetsfeed"\ntype="application/atom+xml" /><ns0:link\nhref="http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpeadocious"\nrel="self" type="application/atom+xml" /><ns0:title type="text">Test Spreadsheet</ns0:title><ns0:updated>2007-07-03T18:03:32.045Z</ns0:updated></ns0:entry><ns0:entry><ns0:content\nsrc="http://docs.google.com/RawDocContents?action=fetch&amp;docID=gr00vy"\ntype="text/html"\n/><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category\nlabel="document" scheme="http://schemas.google.com/g/2005#kind"\nterm="http://schemas.google.com/docs/2007#document"\n/><ns0:id>http://docs.google.com/feeds/documents/private/full/document%3Agr00vy</ns0:id><ns0:link\nhref="http://foobar.com/Doc?id=gr00vy" rel="alternate" type="text/html"\n/><ns0:link\nhref="http://docs.google.com/feeds/documents/private/full/document%3Agr00vy"\nrel="self" type="application/atom+xml" /><ns0:title type="text">Test Document</ns0:title><ns0:updated>2007-07-03T18:02:50.338Z</ns0:updated></ns0:entry><ns0:id>http://docs.google.com/feeds/documents/private/full</ns0:id><ns0:link\nhref="http://docs.google.com" rel="alternate" type="text/html" /><ns0:link\nhref="http://docs.google.com/feeds/documents/private/full"\nrel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"\n/><ns0:link href="http://docs.google.com/feeds/documents/private/full"\nrel="http://schemas.google.com/g/2005#post" type="application/atom+xml"\n/><ns0:link href="http://docs.google.com/feeds/documents/private/full"\nrel="self" type="application/atom+xml" /><ns0:title type="text">Available\nDocuments -\ntest.user@gmail.com</ns0:title><ns0:updated>2007-07-09T23:07:21.898Z</ns0:updated></ns0:feed>\n' document_list_entry = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom"><ns0:content\nsrc="http://foo.com/fm?fmcmd=102&amp;key=supercalifragilisticexpealidocious"\ntype="text/html"\n/><ns0:author><ns0:name>test.user</ns0:name><ns0:email>test.user@gmail.com</ns0:email></ns0:author><ns0:category\nlabel="spreadsheet" scheme="http://schemas.google.com/g/2005#kind"\nterm="http://schemas.google.com/docs/2007#spreadsheet"\n/><ns0:id>http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpealidocious</ns0:id><ns0:link\nhref="http://foo.com/ccc?key=supercalifragilisticexpealidocious"\nrel="alternate" type="text/html" /><ns0:link\nhref="http://foo.com/feeds/worksheets/supercalifragilisticexpealidocious/private/full"\nrel="http://schemas.google.com/spreadsheets/2006#worksheetsfeed"\ntype="application/atom+xml" /><ns0:link\nhref="http://docs.google.com/feeds/documents/private/full/spreadsheet%3Asupercalifragilisticexpealidocious"\nrel="self" type="application/atom+xml" /><ns0:title type="text">Test Spreadsheet</ns0:title><ns0:updated>2007-07-03T18:03:32.045Z</ns0:updated></ns0:entry>\n' batch_entry = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:batch="http://schemas.google.com/gdata/batch" \n xmlns:g="http://base.google.com/ns/1.0">\n <id>http://www.google.com/base/feeds/items/2173859253842813008</id>\n <published>2006-07-11T14:51:43.560Z</published>\n <updated>2006-07-11T14:51: 43.560Z</updated>\n <title type="text">title</title>\n <content type="html">content</content>\n <link rel="self" \n type="application/atom+xml" \n href="http://www.google.com/base/feeds/items/2173859253842813008"/>\n <link rel="edit" \n type="application/atom+xml" \n href="http://www.google.com/base/feeds/items/2173859253842813008"/>\n <g:item_type>recipes</g:item_type>\n <batch:operation type="insert"/>\n <batch:id>itemB</batch:id>\n <batch:status code="201" reason="Created"/>\n</entry>' batch_feed_request = '<?xml version="1.0" encoding="UTF-8"?>\n<feed\n xmlns="http://www.w3.org/2005/Atom"\n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:g="http://base.google.com/ns/1.0"\n xmlns:batch="http://schemas.google.com/gdata/batch">\n <title type="text">My Batch Feed</title>\n <entry>\n <id>http://www.google.com/base/feeds/items/13308004346459454600</id>\n <batch:operation type="delete"/>\n </entry>\n <entry>\n <id>http://www.google.com/base/feeds/items/17437536661927313949</id>\n <batch:operation type="delete"/>\n </entry>\n <entry>\n <title type="text">...</title>\n <content type="html">...</content>\n <batch:id>itemA</batch:id>\n <batch:operation type="insert"/>\n <g:item_type>recipes</g:item_type>\n </entry>\n <entry>\n <title type="text">...</title>\n <content type="html">...</content>\n <batch:id>itemB</batch:id>\n <batch:operation type="insert"/>\n <g:item_type>recipes</g:item_type>\n </entry>\n</feed>' batch_feed_result = '<?xml version="1.0" encoding="UTF-8"?>\n<feed\n xmlns="http://www.w3.org/2005/Atom"\n xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"\n xmlns:g="http://base.google.com/ns/1.0"\n xmlns:batch="http://schemas.google.com/gdata/batch">\n <id>http://www.google.com/base/feeds/items</id>\n <updated>2006-07-11T14:51:42.894Z</updated>\n <title type="text">My Batch</title>\n <link rel="http://schemas.google.com/g/2005#feed"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items"/>\n <link rel="http://schemas.google.com/g/2005#post"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items"/>\n <link rel=" http://schemas.google.com/g/2005#batch"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items/batch"/>\n <entry>\n <id>http://www.google.com/base/feeds/items/2173859253842813008</id>\n <published>2006-07-11T14:51:43.560Z</published>\n <updated>2006-07-11T14:51: 43.560Z</updated>\n <title type="text">...</title>\n <content type="html">...</content>\n <link rel="self"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items/2173859253842813008"/>\n <link rel="edit"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items/2173859253842813008"/>\n <g:item_type>recipes</g:item_type>\n <batch:operation type="insert"/>\n <batch:id>itemB</batch:id>\n <batch:status code="201" reason="Created"/>\n </entry>\n <entry>\n <id>http://www.google.com/base/feeds/items/11974645606383737963</id>\n <published>2006-07-11T14:51:43.247Z</published>\n <updated>2006-07-11T14:51: 43.247Z</updated>\n <title type="text">...</title>\n <content type="html">...</content>\n <link rel="self"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items/11974645606383737963"/>\n <link rel="edit"\n type="application/atom+xml"\n href="http://www.google.com/base/feeds/items/11974645606383737963"/>\n <g:item_type>recipes</g:item_type>\n <batch:operation type="insert"/>\n <batch:id>itemA</batch:id>\n <batch:status code="201" reason="Created"/>\n </entry>\n <entry>\n <id>http://www.google.com/base/feeds/items/13308004346459454600</id>\n <updated>2006-07-11T14:51:42.894Z</updated>\n <title type="text">Error</title>\n <content type="text">Bad request</content>\n <batch:status code="404"\n reason="Bad request"\n content-type="application/xml">\n <errors>\n <error type="request" reason="Cannot find item"/>\n </errors>\n </batch:status>\n </entry>\n <entry>\n <id>http://www.google.com/base/feeds/items/17437536661927313949</id>\n <updated>2006-07-11T14:51:43.246Z</updated>\n <content type="text">Deleted</content>\n <batch:operation type="delete"/>\n <batch:status code="200" reason="Success"/>\n </entry>\n</feed>' album_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:exif="http://schemas.google.com/photos/exif/2007" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gml="http://www.opengis.net/gml" xmlns:georss="http://www.georss.org/georss" xmlns:photo="http://www.pheed.com/pheed/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gphoto="http://schemas.google.com/photos/2007">\n <id>http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1</id>\n <updated>2007-09-21T18:23:05.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#album"/>\n <title type="text">Test</title>\n <subtitle type="text"/>\n <rights type="text">public</rights>\n <icon>http://lh6.google.com/sample.user/Rt8WNoDZEJE/AAAAAAAAABk/HQGlDhpIgWo/s160-c/Test.jpg</icon>\n <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1"/>\n <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test"/>\n <link rel="http://schemas.google.com/photos/2007#slideshow" type="application/x-shockwave-flash" href="http://picasaweb.google.com/s/c/bin/slideshow.swf?host=picasaweb.google.com&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fsample.user%2Falbumid%2F1%3Falt%3Drss"/>\n <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1?start-index=1&amp;max-results=500&amp;kind=photo%2Ctag"/>\n <author>\n <name>sample</name>\n <uri>http://picasaweb.google.com/sample.user</uri>\n </author>\n <generator version="1.00" uri="http://picasaweb.google.com/">Picasaweb</generator> <openSearch:totalResults>4</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>500</openSearch:itemsPerPage>\n <gphoto:id>1</gphoto:id>\n <gphoto:name>Test</gphoto:name>\n <gphoto:location/>\n <gphoto:access>public</gphoto:access> <gphoto:timestamp>1188975600000</gphoto:timestamp>\n <gphoto:numphotos>2</gphoto:numphotos>\n <gphoto:user>sample.user</gphoto:user>\n <gphoto:nickname>sample</gphoto:nickname>\n <gphoto:commentingEnabled>true</gphoto:commentingEnabled>\n <gphoto:commentCount>0</gphoto:commentCount>\n <entry> <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/2</id>\n <published>2007-09-05T20:49:23.000Z</published>\n <updated>2007-09-21T18:23:05.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#photo"/>\n <title type="text">Aqua Blue.jpg</title>\n <summary type="text">Blue</summary>\n <content type="image/jpeg" src="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/Aqua%20Blue.jpg"/> <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1/photoid/2"/>\n <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test/photo#2"/>\n <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/2"/>\n <gphoto:id>2</gphoto:id>\n <gphoto:version>1190398985145172</gphoto:version>\n <gphoto:position>0.0</gphoto:position>\n <gphoto:albumid>1</gphoto:albumid> <gphoto:width>2560</gphoto:width>\n <gphoto:height>1600</gphoto:height>\n <gphoto:size>883405</gphoto:size>\n <gphoto:client/>\n <gphoto:checksum/>\n <gphoto:timestamp>1189025362000</gphoto:timestamp>\n <exif:tags> <exif:flash>true</exif:flash>\n <exif:imageUniqueID>c041ce17aaa637eb656c81d9cf526c24</exif:imageUniqueID>\n </exif:tags>\n <gphoto:commentingEnabled>true</gphoto:commentingEnabled>\n <gphoto:commentCount>1</gphoto:commentCount>\n <media:group>\n <media:title type="plain">Aqua Blue.jpg</media:title> <media:description type="plain">Blue</media:description>\n <media:keywords>tag, test</media:keywords>\n <media:content url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/Aqua%20Blue.jpg" height="1600" width="2560" type="image/jpeg" medium="image"/>\n <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s72/Aqua%20Blue.jpg" height="45" width="72"/>\n <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s144/Aqua%20Blue.jpg" height="90" width="144"/>\n <media:thumbnail url="http://lh4.google.com/sample.user/Rt8WU4DZEKI/AAAAAAAAABY/IVgLqmnzJII/s288/Aqua%20Blue.jpg" height="180" width="288"/>\n <media:credit>sample</media:credit>\n </media:group>\n </entry>\n <entry>\n <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/3</id>\n <published>2007-09-05T20:49:24.000Z</published>\n <updated>2007-09-21T18:19:38.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#photo"/>\n <title type="text">Aqua Graphite.jpg</title>\n <summary type="text">Gray</summary>\n <content type="image/jpeg" src="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/Aqua%20Graphite.jpg"/>\n <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1/photoid/3"/>\n <link rel="alternate" type="text/html" href="http://picasaweb.google.com/sample.user/Test/photo#3"/>\n <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/photoid/3"/>\n <gphoto:id>3</gphoto:id>\n <gphoto:version>1190398778006402</gphoto:version>\n <gphoto:position>1.0</gphoto:position>\n <gphoto:albumid>1</gphoto:albumid>\n <gphoto:width>2560</gphoto:width>\n <gphoto:height>1600</gphoto:height>\n <gphoto:size>798334</gphoto:size>\n <gphoto:client/>\n <gphoto:checksum/>\n <gphoto:timestamp>1189025363000</gphoto:timestamp>\n <exif:tags>\n <exif:flash>true</exif:flash>\n <exif:imageUniqueID>a5ce2e36b9df7d3cb081511c72e73926</exif:imageUniqueID>\n </exif:tags>\n <gphoto:commentingEnabled>true</gphoto:commentingEnabled>\n <gphoto:commentCount>0</gphoto:commentCount>\n <media:group>\n <media:title type="plain">Aqua Graphite.jpg</media:title>\n <media:description type="plain">Gray</media:description>\n <media:keywords/>\n <media:content url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/Aqua%20Graphite.jpg" height="1600" width="2560" type="image/jpeg" medium="image"/>\n <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s72/Aqua%20Graphite.jpg" height="45" width="72"/>\n <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s144/Aqua%20Graphite.jpg" height="90" width="144"/>\n <media:thumbnail url="http://lh5.google.com/sample.user/Rt8WVIDZELI/AAAAAAAAABg/d7e0i7gvhNU/s288/Aqua%20Graphite.jpg" height="180" width="288"/>\n <media:credit>sample</media:credit>\n </media:group>\n </entry>\n <entry>\n <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/tag</id>\n <updated>2007-09-05T20:49:24.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#tag"/>\n <title type="text">tag</title>\n <summary type="text">tag</summary>\n <link rel="alternate" type="text/html" href="http://picasaweb.google.com/lh/searchbrowse?q=tag&amp;psc=G&amp;uname=sample.user&amp;filter=0"/>\n <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/tag"/>\n <author>\n <name>sample</name>\n <uri>http://picasaweb.google.com/sample.user</uri>\n </author>\n </entry>\n <entry>\n <id>http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/test</id>\n <updated>2007-09-05T20:49:24.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/photos/2007#tag"/>\n <title type="text">test</title>\n <summary type="text">test</summary>\n <link rel="alternate" type="text/html" href="http://picasaweb.google.com/lh/searchbrowse?q=test&amp;psc=G&amp;uname=sample.user&amp;filter=0"/>\n <link rel="self" type="application/atom+xml" href="http://picasaweb.google.com/data/entry/api/user/sample.user/albumid/1/tag/test"/>\n <author>\n <name>sample</name>\n <uri>http://picasaweb.google.com/sample.user</uri>\n </author>\n </entry>\n</feed>' code_search_feed = '<?xml version="1.0" encoding="UTF-8"?>\n<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gcs="http://schemas.google.com/codesearch/2006" xml:base="http://www.google.com">\n<id>http://www.google.com/codesearch/feeds/search?q=malloc</id>\n<updated>2007-12-19T16:08:04Z</updated> \n<title type="text">Google Code Search</title>\n<generator version="1.0" uri="http://www.google.com/codesearch">Google Code Search</generator>\n<opensearch:totalResults>2530000</opensearch:totalResults>\n<opensearch:startIndex>1</opensearch:startIndex>\n<author>\n<name>Google Code Search</name>\n\n<uri>http://www.google.com/codesearch</uri>\n</author>\n<link rel="http://schemas.google.com/g/2006#feed" type="application/atom+xml" href="http://schemas.google.com/codesearch/2006"/>\n<link rel="self" type="application/atom+xml" href="http://www.google.com/codesearch/feeds/search?q=malloc"/>\n<link rel="next" type="application/atom+xml" href="http://www.google.com/codesearch/feeds/search?q=malloc&amp;start-index=11"/>\n<link rel="alternate" type="text/html" href="http://www.google.com/codesearch?q=malloc"/>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:LDjwp-Iqc7U:84hEYaYsZk8:xDGReDhvNi0&amp;sa=N&amp;ct=rx&amp;cd=1&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">software/autoconf/manual/autoconf-2.60/autoconf.html</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:LDjwp-Iqc7U:84hEYaYsZk8:xDGReDhvNi0&amp;sa=N&amp;ct=rx&amp;cd=1&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002&amp;cs_p=http://www.gnu.org&amp;cs_f=software/autoconf/manual/autoconf-2.60/autoconf.html-002#first"/><gcs:package name="http://www.gnu.org" uri="http://www.gnu.org"></gcs:package><gcs:file name="software/autoconf/manual/autoconf-2.60/autoconf.html-002"></gcs:file><content type="text/html">&lt;pre&gt; 8: void *&lt;b&gt;malloc&lt;/b&gt; ();\n \n\n&lt;/pre&gt;</content><gcs:match lineNumber="4" type="text/html">&lt;pre&gt; #undef &lt;b&gt;malloc&lt;/b&gt;\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="8" type="text/html">&lt;pre&gt; void *&lt;b&gt;malloc&lt;/b&gt; ();\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="14" type="text/html">&lt;pre&gt; rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n)\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="18" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n);\n\n&lt;/pre&gt;</gcs:match></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:h4hfh-fV-jI:niBq_bwWZNs:H0OhClf0HWQ&amp;sa=N&amp;ct=rx&amp;cd=2&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">guile-1.6.8/libguile/mallocs.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:h4hfh-fV-jI:niBq_bwWZNs:H0OhClf0HWQ&amp;sa=N&amp;ct=rx&amp;cd=2&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c&amp;cs_p=ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz&amp;cs_f=guile-1.6.8/libguile/mallocs.c#first"/><gcs:package name="ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz" uri="ftp://ftp.gnu.org/gnu/guile/guile-1.6.8.tar.gz"></gcs:package><gcs:file name="guile-1.6.8/libguile/mallocs.c"></gcs:file><content type="text/html">&lt;pre&gt; 86: {\n scm_t_bits mem = n ? (scm_t_bits) &lt;b&gt;malloc&lt;/b&gt; (n) : 0;\n if (n &amp;amp;&amp;amp; !mem)\n\n&lt;/pre&gt;</content><gcs:match lineNumber="54" type="text/html">&lt;pre&gt;#include &amp;lt;&lt;b&gt;malloc&lt;/b&gt;.h&amp;gt;\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="62" type="text/html">&lt;pre&gt;scm_t_bits scm_tc16_&lt;b&gt;malloc&lt;/b&gt;;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="66" type="text/html">&lt;pre&gt;&lt;b&gt;malloc&lt;/b&gt;_free (SCM ptr)\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="75" type="text/html">&lt;pre&gt;&lt;b&gt;malloc&lt;/b&gt;_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="77" type="text/html">&lt;pre&gt; scm_puts(&amp;quot;#&amp;lt;&lt;b&gt;malloc&lt;/b&gt; &amp;quot;, port);\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="87" type="text/html">&lt;pre&gt; scm_t_bits mem = n ? (scm_t_bits) &lt;b&gt;malloc&lt;/b&gt; (n) : 0;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="90" type="text/html">&lt;pre&gt; SCM_RETURN_NEWSMOB (scm_tc16_&lt;b&gt;malloc&lt;/b&gt;, mem);\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="98" type="text/html">&lt;pre&gt; scm_tc16_&lt;b&gt;malloc&lt;/b&gt; = scm_make_smob_type (&amp;quot;&lt;b&gt;malloc&lt;/b&gt;&amp;quot;, 0);\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="99" type="text/html">&lt;pre&gt; scm_set_smob_free (scm_tc16_&lt;b&gt;malloc&lt;/b&gt;, &lt;b&gt;malloc&lt;/b&gt;_free);\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:9wyZUG-N_30:7_dFxoC1ZrY:C0_iYbFj90M&amp;sa=N&amp;ct=rx&amp;cd=3&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">bash-3.0/lib/malloc/alloca.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:9wyZUG-N_30:7_dFxoC1ZrY:C0_iYbFj90M&amp;sa=N&amp;ct=rx&amp;cd=3&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c&amp;cs_p=http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz&amp;cs_f=bash-3.0/lib/malloc/alloca.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz" uri="http://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz"></gcs:package><gcs:file name="bash-3.0/lib/malloc/alloca.c"></gcs:file><content type="text/html">&lt;pre&gt; 78: #ifndef emacs\n #define &lt;b&gt;malloc&lt;/b&gt; x&lt;b&gt;malloc&lt;/b&gt;\n extern pointer x&lt;b&gt;malloc&lt;/b&gt; ();\n\n&lt;/pre&gt;</content><gcs:match lineNumber="69" type="text/html">&lt;pre&gt; &lt;b&gt;malloc&lt;/b&gt;. The Emacs executable needs alloca to call x&lt;b&gt;malloc&lt;/b&gt;, because\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="70" type="text/html">&lt;pre&gt; ordinary &lt;b&gt;malloc&lt;/b&gt; isn&amp;#39;t protected from input signals. On the other\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="71" type="text/html">&lt;pre&gt; hand, the utilities in lib-src need alloca to call &lt;b&gt;malloc&lt;/b&gt;; some of\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="72" type="text/html">&lt;pre&gt; them are very simple, and don&amp;#39;t have an x&lt;b&gt;malloc&lt;/b&gt; routine.\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="76" type="text/html">&lt;pre&gt; Callers below should use &lt;b&gt;malloc&lt;/b&gt;. */\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="79" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt; x&lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="80" type="text/html">&lt;pre&gt;extern pointer x&lt;b&gt;malloc&lt;/b&gt; ();\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="132" type="text/html">&lt;pre&gt; It is very important that sizeof(header) agree with &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="198" type="text/html">&lt;pre&gt; register pointer new = &lt;b&gt;malloc&lt;/b&gt; (sizeof (header) + size);\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:uhVCKyPcT6k:8juMxxzmUJw:H7_IDsTB2L4&amp;sa=N&amp;ct=rx&amp;cd=4&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">mozilla/xpcom/build/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:uhVCKyPcT6k:8juMxxzmUJw:H7_IDsTB2L4&amp;sa=N&amp;ct=rx&amp;cd=4&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c&amp;cs_p=http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2&amp;cs_f=mozilla/xpcom/build/malloc.c#first"/><gcs:package name="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2" uri="http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7b/src/mozilla-source-1.7b-source.tar.bz2"></gcs:package><gcs:file name="mozilla/xpcom/build/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 54: http://gee.cs.oswego.edu/dl/html/&lt;b&gt;malloc&lt;/b&gt;.html\n \n You may already by default be using a c library containing a &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</content><gcs:match lineNumber="4" type="text/html">&lt;pre&gt;/* ---------- To make a &lt;b&gt;malloc&lt;/b&gt;.h, start cutting here ------------ */\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="22" type="text/html">&lt;pre&gt; Note: There may be an updated version of this &lt;b&gt;malloc&lt;/b&gt; obtainable at\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="23" type="text/html">&lt;pre&gt; ftp://gee.cs.oswego.edu/pub/misc/&lt;b&gt;malloc&lt;/b&gt;.c\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="34" type="text/html">&lt;pre&gt;* Why use this &lt;b&gt;malloc&lt;/b&gt;?\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="37" type="text/html">&lt;pre&gt; most tunable &lt;b&gt;malloc&lt;/b&gt; ever written. However it is among the fastest\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="40" type="text/html">&lt;pre&gt; allocator for &lt;b&gt;malloc&lt;/b&gt;-intensive programs.\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="54" type="text/html">&lt;pre&gt; http://gee.cs.oswego.edu/dl/html/&lt;b&gt;malloc&lt;/b&gt;.html\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="56" type="text/html">&lt;pre&gt; You may already by default be using a c library containing a &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="57" type="text/html">&lt;pre&gt; that is somehow based on some version of this &lt;b&gt;malloc&lt;/b&gt; (for example in\n&lt;/pre&gt;</gcs:match><rights>Mozilla</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:4n1P2HVOISs:Ybbpph0wR2M:OhIN_sDrG0U&amp;sa=N&amp;ct=rx&amp;cd=5&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:4n1P2HVOISs:Ybbpph0wR2M:OhIN_sDrG0U&amp;sa=N&amp;ct=rx&amp;cd=5&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh&amp;cs_p=http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz&amp;cs_f=hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh#first"/><gcs:package name="http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz" uri="http://regexps.srparish.net/src/hackerlab/hackerlab-1.0pre2.tar.gz"></gcs:package><gcs:file name="hackerlab-1.0pre2/src/hackerlab/tests/mem-tests/unit-must-malloc.sh"></gcs:file><content type="text/html">&lt;pre&gt; 11: echo ================ unit-must-&lt;b&gt;malloc&lt;/b&gt; tests ================\n ./unit-must-&lt;b&gt;malloc&lt;/b&gt;\n echo ...passed\n\n&lt;/pre&gt;</content><gcs:match lineNumber="2" type="text/html">&lt;pre&gt;# tag: Tom Lord Tue Dec 4 14:54:29 2001 (mem-tests/unit-must-&lt;b&gt;malloc&lt;/b&gt;.sh)\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="11" type="text/html">&lt;pre&gt;echo ================ unit-must-&lt;b&gt;malloc&lt;/b&gt; tests ================\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="12" type="text/html">&lt;pre&gt;./unit-must-&lt;b&gt;malloc&lt;/b&gt;\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:GzkwiWG266M:ykuz3bG00ws:2sTvVSif08g&amp;sa=N&amp;ct=rx&amp;cd=6&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">tar-1.14/lib/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:GzkwiWG266M:ykuz3bG00ws:2sTvVSif08g&amp;sa=N&amp;ct=rx&amp;cd=6&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2&amp;cs_f=tar-1.14/lib/malloc.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2" uri="http://ftp.gnu.org/gnu/tar/tar-1.14.tar.bz2"></gcs:package><gcs:file name="tar-1.14/lib/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 22: #endif\n #undef &lt;b&gt;malloc&lt;/b&gt;\n \n\n&lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* Work around bug on some systems where &lt;b&gt;malloc&lt;/b&gt; (0) fails.\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="23" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="31" type="text/html">&lt;pre&gt;rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n)\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="35" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n);\n\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:o_TFIeBY6dY:ktI_dt8wPao:AI03BD1Dz0Y&amp;sa=N&amp;ct=rx&amp;cd=7&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">tar-1.16.1/lib/malloc.c</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:o_TFIeBY6dY:ktI_dt8wPao:AI03BD1Dz0Y&amp;sa=N&amp;ct=rx&amp;cd=7&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c&amp;cs_p=http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz&amp;cs_f=tar-1.16.1/lib/malloc.c#first"/><gcs:package name="http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz" uri="http://ftp.gnu.org/gnu/tar/tar-1.16.1.tar.gz"></gcs:package><gcs:file name="tar-1.16.1/lib/malloc.c"></gcs:file><content type="text/html">&lt;pre&gt; 21: #include &amp;lt;config.h&amp;gt;\n #undef &lt;b&gt;malloc&lt;/b&gt;\n \n\n&lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* &lt;b&gt;malloc&lt;/b&gt;() function that is glibc compatible.\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="22" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="30" type="text/html">&lt;pre&gt;rpl_&lt;b&gt;malloc&lt;/b&gt; (size_t n)\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="34" type="text/html">&lt;pre&gt; return &lt;b&gt;malloc&lt;/b&gt; (n);\n\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:_ibw-VLkMoI:jBOtIJSmFd4:-0NUEVeCwfY&amp;sa=N&amp;ct=rx&amp;cd=8&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">uClibc-0.9.29/include/malloc.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:_ibw-VLkMoI:jBOtIJSmFd4:-0NUEVeCwfY&amp;sa=N&amp;ct=rx&amp;cd=8&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h&amp;cs_p=http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2&amp;cs_f=uClibc-0.9.29/include/malloc.h#first"/><gcs:package name="http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2" uri="http://freshmeat.net/redir/uclibc/20616/url_bz2/uClibc-0.9.28.1.tar.bz2"></gcs:package><gcs:file name="uClibc-0.9.29/include/malloc.h"></gcs:file><content type="text/html">&lt;pre&gt; 1: /* Prototypes and definition for &lt;b&gt;malloc&lt;/b&gt; implementation.\n Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.\n\n&lt;/pre&gt;</content><gcs:match lineNumber="1" type="text/html">&lt;pre&gt;/* Prototypes and definition for &lt;b&gt;malloc&lt;/b&gt; implementation.\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="26" type="text/html">&lt;pre&gt; `pt&lt;b&gt;malloc&lt;/b&gt;&amp;#39;, a &lt;b&gt;malloc&lt;/b&gt; implementation for multiple threads without\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="28" type="text/html">&lt;pre&gt; See the files `pt&lt;b&gt;malloc&lt;/b&gt;.c&amp;#39; or `COPYRIGHT&amp;#39; for copying conditions.\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="32" type="text/html">&lt;pre&gt; This work is mainly derived from &lt;b&gt;malloc&lt;/b&gt;-2.6.4 by Doug Lea\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="35" type="text/html">&lt;pre&gt; ftp://g.oswego.edu/pub/misc/&lt;b&gt;malloc&lt;/b&gt;.c\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="40" type="text/html">&lt;pre&gt; `pt&lt;b&gt;malloc&lt;/b&gt;.c&amp;#39;.\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="45" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_ptr_t void *\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="51" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_ptr_t char *\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="56" type="text/html">&lt;pre&gt;# define __&lt;b&gt;malloc&lt;/b&gt;_size_t size_t\n&lt;/pre&gt;</gcs:match><rights>LGPL</rights></entry>\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:F6qHcZ9vefo:bTX7o9gKfks:hECF4r_eKC0&amp;sa=N&amp;ct=rx&amp;cd=9&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">glibc-2.0.1/hurd/hurdmalloc.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:F6qHcZ9vefo:bTX7o9gKfks:hECF4r_eKC0&amp;sa=N&amp;ct=rx&amp;cd=9&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h&amp;cs_p=http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz&amp;cs_f=glibc-2.0.1/hurd/hurdmalloc.h#first"/><gcs:package name="http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz" uri="http://ftp.gnu.org/gnu/glibc/glibc-2.0.1.tar.gz"></gcs:package><gcs:file name="glibc-2.0.1/hurd/hurdmalloc.h"></gcs:file><content type="text/html">&lt;pre&gt; 15: #define &lt;b&gt;malloc&lt;/b&gt; _hurd_&lt;b&gt;malloc&lt;/b&gt;\n #define realloc _hurd_realloc\n\n&lt;/pre&gt;</content><gcs:match lineNumber="3" type="text/html">&lt;pre&gt; All hurd-internal code which uses &lt;b&gt;malloc&lt;/b&gt; et al includes this file so it\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="4" type="text/html">&lt;pre&gt; will use the internal &lt;b&gt;malloc&lt;/b&gt; routines _hurd_{&lt;b&gt;malloc&lt;/b&gt;,realloc,free}\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="7" type="text/html">&lt;pre&gt; of &lt;b&gt;malloc&lt;/b&gt; et al is the unixoid one using sbrk.\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="11" type="text/html">&lt;pre&gt;extern void *_hurd_&lt;b&gt;malloc&lt;/b&gt; (size_t);\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="15" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt; _hurd_&lt;b&gt;malloc&lt;/b&gt;\n&lt;/pre&gt;</gcs:match><rights>GPL</rights></entry>\n\n<entry><id>http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:CHUvHYzyLc8:pdcAfzDA6lY:wjofHuNLTHg&amp;sa=N&amp;ct=rx&amp;cd=10&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h#first</id><updated>2007-12-19T16:08:04Z</updated><author><name>Code owned by external author.</name></author><title type="text">httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h</title><link rel="alternate" type="text/html" href="http://www.google.com/codesearch?hl=en&amp;q=+malloc+show:CHUvHYzyLc8:pdcAfzDA6lY:wjofHuNLTHg&amp;sa=N&amp;ct=rx&amp;cd=10&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h&amp;cs_p=ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2&amp;cs_f=httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h#first"/><gcs:package name="ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2" uri="ftp://apache.mirrors.pair.com/httpd/httpd-2.2.4.tar.bz2"></gcs:package><gcs:file name="httpd-2.2.4/srclib/apr/include/arch/netware/apr_private.h"></gcs:file><content type="text/html">&lt;pre&gt; 173: #undef &lt;b&gt;malloc&lt;/b&gt;\n #define &lt;b&gt;malloc&lt;/b&gt;(x) library_&lt;b&gt;malloc&lt;/b&gt;(gLibHandle,x)\n\n&lt;/pre&gt;</content><gcs:match lineNumber="170" type="text/html">&lt;pre&gt;/* Redefine &lt;b&gt;malloc&lt;/b&gt; to use the library &lt;b&gt;malloc&lt;/b&gt; call so\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="173" type="text/html">&lt;pre&gt;#undef &lt;b&gt;malloc&lt;/b&gt;\n\n&lt;/pre&gt;</gcs:match><gcs:match lineNumber="174" type="text/html">&lt;pre&gt;#define &lt;b&gt;malloc&lt;/b&gt;(x) library_&lt;b&gt;malloc&lt;/b&gt;(gLibHandle,x)\n&lt;/pre&gt;</gcs:match><rights>Apache</rights></entry>\n\n</feed>' you_tube_video_feed = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<feed xmlns=\'http://www.w3.org/2005/Atom\'\n xmlns:openSearch=\'http://a9.com/-/spec/opensearchrss/1.0/\'\n xmlns:gml=\'http://www.opengis.net/gml\'\n xmlns:georss=\'http://www.georss.org/georss\'\n xmlns:media=\'http://search.yahoo.com/mrss/\'\n xmlns:yt=\'http://gdata.youtube.com/schemas/2007\'\n xmlns:gd=\'http://schemas.google.com/g/2005\'>\n <id>http://gdata.youtube.com/feeds/api/standardfeeds/top_rated</id>\n <updated>2008-02-21T18:57:10.801Z</updated>\n <category scheme=\'http://schemas.google.com/g/2005#kind\'\n term=\'http://gdata.youtube.com/schemas/2007#video\'/>\n <title type=\'text\'>Top Rated</title>\n <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>\n <link rel=\'alternate\' type=\'text/html\'\n href=\'http://www.youtube.com/browser?s=tr\'/>\n <link rel=\'http://schemas.google.com/g/2005#feed\' type=\'application/atom+xml\'\n href=\'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated\'/>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?start_index=1&amp;max-results=25\'/>\n <link rel=\'self\' type=\'application/atom+xml\'\n href=\'http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?start_index=26&amp;max-results=25\'/>\n <author>\n <name>YouTube</name>\n <uri>http://www.youtube.com/</uri>\n </author>\n <generator version=\'beta\'\n uri=\'http://gdata.youtube.com/\'>YouTube data API</generator>\n <openSearch:totalResults>99</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <entry>\n <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b</id>\n <published>2007-02-16T20:22:57.000Z</published>\n <updated>2007-02-16T20:22:57.000Z</updated>\n <category scheme="http://schemas.google.com/g/2005#kind"\n term="http://gdata.youtube.com/schemas/2007#video"/>\n <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat"\n term="Steventon"/>\n <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat"\n term="walk"/>\n <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat"\n term="Darcy"/>\n <category scheme="http://gdata.youtube.com/schemas/2007/categories.cat"\n term="Entertainment" label="Entertainment"/>\n <title type="text">My walk with Mr. Darcy</title>\n <content type="html"><div ... html content trimmed ...></content>\n <link rel="self" type="application/atom+xml"\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b"/>\n <link rel="alternate" type="text/html"\n href="http://www.youtube.com/watch?v=ZTUVgYoeN_b"/>\n <link rel="http://gdata.youtube.com/schemas/2007#video.responses"\n type="application/atom+xml"\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/responses"/>\n <link rel="http://gdata.youtube.com/schemas/2007#video.ratings"\n type="application/atom+xml"\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/ratings"/>\n <link rel="http://gdata.youtube.com/schemas/2007#video.complaints"\n type="application/atom+xml"\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/complaints"/>\n <link rel="http://gdata.youtube.com/schemas/2007#video.related"\n type="application/atom+xml"\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/related"/>\n <author>\n <name>Andy Samplo</name>\n <uri>http://gdata.youtube.com/feeds/api/users/andyland74</uri>\n </author>\n <media:group>\n <media:title type="plain">Shopping for Coats</media:title>\n <media:description type="plain">\n What could make for more exciting video?\n </media:description>\n <media:keywords>Shopping, parkas</media:keywords>\n <yt:duration seconds="79"/>\n <media:category label="People"\n scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People\n </media:category>\n <media:content\n url=\'http://www.youtube.com/v/ZTUVgYoeN_b\'\n type=\'application/x-shockwave-flash\' medium=\'video\' \n isDefault=\'true\' expression="full" duration=\'215\' yt:format="5"/>\n <media:content\n url=\'rtsp://rtsp2.youtube.com/ChoLENy73bIAEQ1k30OPEgGDA==/0/0/0/video.3gp\'\n type=\'video/3gpp\' medium=\'video\' \n expression="full" duration=\'215\' yt:format="1"/>\n <media:content\n url=\'rtsp://rtsp2.youtube.com/ChoLENy73bIAEQ1k30OPEgGDA==/0/0/0/video.3gp\'\n type=\'video/3gpp\' medium=\'video\' \n expression="full" duration=\'215\' yt:format="6"/>\n <media:player url="http://www.youtube.com/watch?v=ZTUVgYoeN_b"/>\n <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/2.jpg"\n height="97" width="130" time="00:00:03.500"/>\n <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/1.jpg"\n height="97" width="130" time="00:00:01.750"/>\n <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/3.jpg"\n height="97" width="130" time="00:00:05.250"/>\n <media:thumbnail url="http://img.youtube.com/vi/ZTUVgYoeN_b/0.jpg"\n height="240" width="320" time="00:00:03.500"/>\n </media:group>\n <yt:statistics viewCount="93"/>\n <gd:rating min=\'1\' max=\'5\' numRaters=\'435\' average=\'4.94\'/>\n <gd:comments>\n <gd:feedLink\n href="http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments"\n countHint=\'2197\'/>\n </gd:comments>\n</entry>\n</feed>' you_tube_comment_feed = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'>\n <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=1&amp;max-results=25</id>\n <updated>2008-02-25T23:14:03.148Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#comment'/>\n <title type='text'>Comments on 'My walk with Mr. Darcy'</title>\n <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>\n <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b'/>\n <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=ZTUVgYoeN_b'/>\n <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments'/>\n <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=1&amp;max-results=25'/>\n <link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments?start-index=26&amp;max-results=25'/>\n <author> \n <name>YouTube</name> \n <uri>http://www.youtube.com/</uri>\n </author> \n <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator>\n <openSearch:totalResults>100</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <entry>\n <id>http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments/7F2BAAD03653A691</id>\n <published>2007-05-23T00:21:59.000-07:00</published>\n <updated>2007-05-23T00:21:59.000-07:00</updated>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#comment'/>\n <title type='text'>Walking is fun.</title>\n <content type='text'>Walking is fun.</content>\n <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b'/>\n <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=ZTUVgYoeN_b'/>\n <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/ZTUVgYoeN_b/comments/7F2BAAD03653A691'/>\n <author>\n <name>andyland744</name>\n <uri>http://gdata.youtube.com/feeds/api/users/andyland744</uri> \n </author> \n </entry> \n</feed>" you_tube_playlist_feed = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom'\n xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' \n xmlns:media='http://search.yahoo.com/mrss/' \n xmlns:yt='http://gdata.youtube.com/schemas/2007' \n xmlns:gd='http://schemas.google.com/g/2005'>\n <id>http://gdata.youtube.com/feeds/users/andyland74/playlists?start-index=1&amp;max-results=25</id>\n <updated>2008-02-26T00:26:15.635Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#playlistLink'/>\n <title type='text'>andyland74's Playlists</title>\n <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>\n <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/>\n <link rel='alternate' type='text/html' href='http://www.youtube.com/profile_play_list?user=andyland74'/>\n <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists'/>\n <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists?start-index=1&amp;max-results=25'/>\n <author>\n <name>andyland74</name>\n <uri>http://gdata.youtube.com/feeds/users/andyland74</uri>\n </author>\n <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator>\n <openSearch:totalResults>1</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <entry>\n <id>http://gdata.youtube.com/feeds/users/andyland74/playlists/8BCDD04DE8F771B2</id>\n <published>2007-11-04T17:30:27.000-08:00</published>\n <updated>2008-02-22T09:55:14.000-08:00</updated>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#playlistLink'/>\n <title type='text'>My New Playlist Title</title>\n <content type='text'>My new playlist Description</content>\n <link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74'/>\n <link rel='alternate' type='text/html' href='http://www.youtube.com/view_play_list?p=8BCDD04DE8F771B2'/>\n <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/users/andyland74/playlists/8BCDD04DE8F771B2'/>\n <author>\n <name>andyland74</name> \n <uri>http://gdata.youtube.com/feeds/users/andyland74</uri>\n </author>\n <yt:description>My new playlist Description</yt:description>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#playlist' href='http://gdata.youtube.com/feeds/playlists/8BCDD04DE8F771B2'/>\n </entry> \n</feed>" you_tube_subscriptions_feed = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom'\n xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'\n xmlns:media='http://search.yahoo.com/mrss/'\n xmlns:yt='http://gdata.youtube.com/schemas/2007'\n xmlns:gd='http://schemas.google.com/g/2005'>\n <id>http://gdata.youtube.com/feeds/users/andyland74/subscriptions?start-index=1&amp;max-results=25</id>\n <updated>2008-02-26T00:26:15.635Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://gdata.youtube.com/schemas/2007#subscription'/>\n <title type='text'>andyland74's Subscriptions</title>\n <logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>\n <link rel='related' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74'/>\n <link rel='alternate' type='text/html'\n href='http://www.youtube.com/profile_subscriptions?user=andyland74'/>\n <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions'/>\n <link rel='self' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions?start-index=1&amp;max-results=25'/>\n <author>\n <name>andyland74</name>\n <uri>http://gdata.youtube.com/feeds/users/andyland74</uri>\n </author>\n <generator version='beta' uri='http://gdata.youtube.com/'>YouTube data API</generator>\n <openSearch:totalResults>1</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <entry>\n <id>http://gdata.youtube.com/feeds/users/andyland74/subscriptions/d411759045e2ad8c</id>\n <published>2007-11-04T17:30:27.000-08:00</published>\n <updated>2008-02-22T09:55:14.000-08:00</updated>\n <category scheme='http://gdata.youtube.com/schemas/2007/subscriptiontypes.cat'\n term='channel'/>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://gdata.youtube.com/schemas/2007#subscription'/>\n <title type='text'>Videos published by : NBC</title>\n <link rel='related' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74'/>\n <link rel='alternate' type='text/html'\n href='http://www.youtube.com/profile_videos?user=NBC'/>\n <link rel='self' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions/d411759045e2ad8c'/>\n <author>\n <name>andyland74</name>\n <uri>http://gdata.youtube.com/feeds/users/andyland74</uri>\n </author>\n <yt:username>NBC</yt:username>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.uploads'\n href='http://gdata.youtube.com/feeds/api/users/nbc/uploads'/>\n </entry>\n</feed>" you_tube_profile = "<?xml version='1.0' encoding='UTF-8'?>\n<entry xmlns='http://www.w3.org/2005/Atom'\n xmlns:media='http://search.yahoo.com/mrss/'\n xmlns:yt='http://gdata.youtube.com/schemas/2007'\n xmlns:gd='http://schemas.google.com/g/2005'>\n <id>http://gdata.youtube.com/feeds/users/andyland74</id>\n <published>2006-10-16T00:09:45.000-07:00</published>\n <updated>2008-02-26T11:48:21.000-08:00</updated>\n <category scheme='http://gdata.youtube.com/schemas/2007/channeltypes.cat'\n term='Standard'/>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://gdata.youtube.com/schemas/2007#userProfile'/>\n <title type='text'>andyland74 Channel</title>\n <link rel='alternate' type='text/html'\n href='http://www.youtube.com/profile?user=andyland74'/>\n <link rel='self' type='application/atom+xml'\n href='http://gdata.youtube.com/feeds/users/andyland74'/>\n <author>\n <name>andyland74</name>\n <uri>http://gdata.youtube.com/feeds/users/andyland74</uri>\n </author>\n <yt:age>33</yt:age>\n <yt:username>andyland74</yt:username>\n <yt:books>Catch-22</yt:books>\n <yt:gender>m</yt:gender>\n <yt:company>Google</yt:company>\n <yt:hobbies>Testing YouTube APIs</yt:hobbies>\n <yt:location>US</yt:location>\n <yt:movies>Aqua Teen Hungerforce</yt:movies>\n <yt:music>Elliott Smith</yt:music>\n <yt:occupation>Technical Writer</yt:occupation>\n <yt:school>University of North Carolina</yt:school>\n <media:thumbnail url='http://i.ytimg.com/vi/YFbSxcdOL-w/default.jpg'/>\n <yt:statistics viewCount='9' videoWatchCount='21' subscriberCount='1'\n lastWebAccess='2008-02-25T16:03:38.000-08:00'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.favorites'\n href='http://gdata.youtube.com/feeds/users/andyland74/favorites' countHint='4'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.contacts'\n href='http://gdata.youtube.com/feeds/users/andyland74/contacts' countHint='1'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.inbox'\n href='http://gdata.youtube.com/feeds/users/andyland74/inbox' countHint='0'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.playlists'\n href='http://gdata.youtube.com/feeds/users/andyland74/playlists'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.subscriptions'\n href='http://gdata.youtube.com/feeds/users/andyland74/subscriptions' countHint='4'/>\n <gd:feedLink rel='http://gdata.youtube.com/schemas/2007#user.uploads'\n href='http://gdata.youtube.com/feeds/users/andyland74/uploads' countHint='1'/>\n</entry>" new_contact = "<?xml version='1.0' encoding='UTF-8'?>\n<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'\n xmlns:gd='http://schemas.google.com/g/2005'>\n <atom:category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' />\n <atom:title type='text'>Elizabeth Bennet</atom:title>\n <atom:content type='text'>Notes</atom:content>\n <gd:email rel='http://schemas.google.com/g/2005#work'\n address='liz@gmail.com' />\n <gd:email rel='http://schemas.google.com/g/2005#home'\n address='liz@example.org' />\n <gd:phoneNumber rel='http://schemas.google.com/g/2005#work'\n primary='true'>(206)555-1212</gd:phoneNumber>\n <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>(206)555-1213</gd:phoneNumber>\n <gd:im address='liz@gmail.com'\n protocol='http://schemas.google.com/g/2005#GOOGLE_TALK'\n rel='http://schemas.google.com/g/2005#home' />\n <gd:postalAddress rel='http://schemas.google.com/g/2005#work'\n primary='true'>1600 Amphitheatre Pkwy Mountain View</gd:postalAddress>\n</atom:entry>" contacts_feed = "<?xml version='1.0' encoding='UTF-8'?>\n<feed xmlns='http://www.w3.org/2005/Atom'\n xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'\n xmlns:gd='http://schemas.google.com/g/2005'>\n <id>http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base</id>\n <updated>2008-03-05T12:36:38.836Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' />\n <title type='text'>Contacts</title>\n <link rel='http://schemas.google.com/g/2005#feed'\n type='application/atom+xml'\n href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base' />\n <link rel='http://schemas.google.com/g/2005#post'\n type='application/atom+xml'\n href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base' />\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base?max-results=25' />\n <author>\n <name>Elizabeth Bennet</name>\n <email>liz@gmail.com</email>\n </author>\n <generator version='1.0' uri='http://www.google.com/m8/feeds/contacts'>Contacts</generator>\n <openSearch:totalResults>1</openSearch:totalResults>\n <openSearch:startIndex>1</openSearch:startIndex>\n <openSearch:itemsPerPage>25</openSearch:itemsPerPage>\n <entry>\n <id>http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de</id>\n <updated>2008-03-05T12:36:38.835Z</updated>\n <category scheme='http://schemas.google.com/g/2005#kind'\n term='http://schemas.google.com/contact/2008#contact' />\n <title type='text'>Fitzgerald</title>\n <link rel='self' type='application/atom+xml'\n href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de' />\n <link rel='edit' type='application/atom+xml'\n href='http://www.google.com/m8/feeds/contacts/liz%40gmail.com/base/c9012de/1204720598835000' />\n <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'\n primary='true'>456</gd:phoneNumber>\n </entry>\n</feed>"
def getQuestions(dir): questions = [] with open(dir, 'r', encoding='utf-8') as f: for line in f: questions.append(line.strip()) return questions def getTriples(dir): triples = [] with open(dir, 'r', encoding='utf-8') as f: for i, line in enumerate(f): line_sp = line.strip() line_list = line_sp.split('\t') triples.append({ 'id': line_list[0], 'triples': line_list[2]}) return triples def getTriplesWithId(id, triples): list = [] for triple in triples: if triple['id'] == str(id): list.append(triple['triples']) return list def format(x): return x.strip()
def get_questions(dir): questions = [] with open(dir, 'r', encoding='utf-8') as f: for line in f: questions.append(line.strip()) return questions def get_triples(dir): triples = [] with open(dir, 'r', encoding='utf-8') as f: for (i, line) in enumerate(f): line_sp = line.strip() line_list = line_sp.split('\t') triples.append({'id': line_list[0], 'triples': line_list[2]}) return triples def get_triples_with_id(id, triples): list = [] for triple in triples: if triple['id'] == str(id): list.append(triple['triples']) return list def format(x): return x.strip()
class MyTooManyWhoisQuerisError(Exception): pass class MyWhoisBanError(Exception): pass
class Mytoomanywhoisqueriserror(Exception): pass class Mywhoisbanerror(Exception): pass
def simple(func): func.__annotation__ = "Hello" return func @simple def foo(): pass def complex(msg): def annotate(func): func.__annotation__ = msg return func return annotate @complex("Hi") def bar(): pass foo bar class C(object): @staticmethod def smeth(arg0, arg1): arg0 arg1 @classmethod def cmeth(cls, arg0): cls arg0
def simple(func): func.__annotation__ = 'Hello' return func @simple def foo(): pass def complex(msg): def annotate(func): func.__annotation__ = msg return func return annotate @complex('Hi') def bar(): pass foo bar class C(object): @staticmethod def smeth(arg0, arg1): arg0 arg1 @classmethod def cmeth(cls, arg0): cls arg0
{ "targets": [ { "target_name": "EspressoLogicMinimizer", "cflags": ["-std=c99", "-Wno-misleading-indentation", "-Wno-unused-result", "-Wno-format-overflow", "-Wno-implicit-fallthrough"], "sources": [ "bridge/addon.cc", "bridge/bridge.c", "espresso-src/black_white.c", "espresso-src/canonical.c", "espresso-src/cofactor.c", "espresso-src/cols.c", "espresso-src/compl.c", "espresso-src/contain.c", "espresso-src/cpu_time.c", "espresso-src/cubestr.c", "espresso-src/cvrin.c", "espresso-src/cvrm.c", "espresso-src/cvrmisc.c", "espresso-src/cvrout.c", "espresso-src/dominate.c", "espresso-src/equiv.c", "espresso-src/espresso.c", "espresso-src/essen.c", "espresso-src/essentiality.c", "espresso-src/exact.c", "espresso-src/expand.c", "espresso-src/gasp.c", "espresso-src/gimpel.c", "espresso-src/globals.c", "espresso-src/hack.c", "espresso-src/indep.c", "espresso-src/irred.c", "espresso-src/map.c", "espresso-src/matrix.c", "espresso-src/mincov.c", "espresso-src/opo.c", "espresso-src/pair.c", "espresso-src/part.c", "espresso-src/primes.c", "espresso-src/prtime.c", "espresso-src/reduce.c", "espresso-src/rows.c", "espresso-src/set.c", "espresso-src/setc.c", "espresso-src/sharp.c", "espresso-src/sigma.c", "espresso-src/signature.c", "espresso-src/signature_exact.c", "espresso-src/sminterf.c", "espresso-src/solution.c", "espresso-src/sparse.c", "espresso-src/unate.c", "espresso-src/util_signature.c", "espresso-src/verify.c" ], "include_dirs" : [ "<!(node -e \"require('nan')\")", "espresso-src" ] } ] }
{'targets': [{'target_name': 'EspressoLogicMinimizer', 'cflags': ['-std=c99', '-Wno-misleading-indentation', '-Wno-unused-result', '-Wno-format-overflow', '-Wno-implicit-fallthrough'], 'sources': ['bridge/addon.cc', 'bridge/bridge.c', 'espresso-src/black_white.c', 'espresso-src/canonical.c', 'espresso-src/cofactor.c', 'espresso-src/cols.c', 'espresso-src/compl.c', 'espresso-src/contain.c', 'espresso-src/cpu_time.c', 'espresso-src/cubestr.c', 'espresso-src/cvrin.c', 'espresso-src/cvrm.c', 'espresso-src/cvrmisc.c', 'espresso-src/cvrout.c', 'espresso-src/dominate.c', 'espresso-src/equiv.c', 'espresso-src/espresso.c', 'espresso-src/essen.c', 'espresso-src/essentiality.c', 'espresso-src/exact.c', 'espresso-src/expand.c', 'espresso-src/gasp.c', 'espresso-src/gimpel.c', 'espresso-src/globals.c', 'espresso-src/hack.c', 'espresso-src/indep.c', 'espresso-src/irred.c', 'espresso-src/map.c', 'espresso-src/matrix.c', 'espresso-src/mincov.c', 'espresso-src/opo.c', 'espresso-src/pair.c', 'espresso-src/part.c', 'espresso-src/primes.c', 'espresso-src/prtime.c', 'espresso-src/reduce.c', 'espresso-src/rows.c', 'espresso-src/set.c', 'espresso-src/setc.c', 'espresso-src/sharp.c', 'espresso-src/sigma.c', 'espresso-src/signature.c', 'espresso-src/signature_exact.c', 'espresso-src/sminterf.c', 'espresso-src/solution.c', 'espresso-src/sparse.c', 'espresso-src/unate.c', 'espresso-src/util_signature.c', 'espresso-src/verify.c'], 'include_dirs': ['<!(node -e "require(\'nan\')")', 'espresso-src']}]}
class Instance(): def __init__(self): self.words=[] self.labels=[] self.words_size=0 self.words_index = [] self.label_index = []
class Instance: def __init__(self): self.words = [] self.labels = [] self.words_size = 0 self.words_index = [] self.label_index = []
LEAGUE_IDS = { "BL": 394, "BL2": 395, "BL3": 403, "FL": 396, "FL2": 397, "EPL": 398, "EL1": 425, "LLIGA": 399, "SD": 400, "SA": 401, "PPL": 402, "DED": 404, "CL": 405 }
league_ids = {'BL': 394, 'BL2': 395, 'BL3': 403, 'FL': 396, 'FL2': 397, 'EPL': 398, 'EL1': 425, 'LLIGA': 399, 'SD': 400, 'SA': 401, 'PPL': 402, 'DED': 404, 'CL': 405}
class Solution: def findRestaurant(self, list1, list2): """ :type list1: List[str] :type list2: List[str] :rtype: List[str] """ dic={} for item1 in list1: for item2 in list2: if item1==item2: dic[item1]=list1.index(item1)+list2.index(item2) return [k for k in dic if dic[k]==min(dic.values())]
class Solution: def find_restaurant(self, list1, list2): """ :type list1: List[str] :type list2: List[str] :rtype: List[str] """ dic = {} for item1 in list1: for item2 in list2: if item1 == item2: dic[item1] = list1.index(item1) + list2.index(item2) return [k for k in dic if dic[k] == min(dic.values())]
{ "targets": [ { "target_name": "polyglot", "sources": [ "polyglot.cpp" ] } ] }
{'targets': [{'target_name': 'polyglot', 'sources': ['polyglot.cpp']}]}
#7-8 & 7-9 # Create our orders list sandwich_orders = ['ham', 'bologna','pastrami', 'cheese', 'blt', 'pastrami', 'turkey', 'pastrami'] finished_sandwiches = [] # Deli is out of pastrami, so we will remove all pastrami orders. print("\nThe deli is out of pastrami sandwiches.") while 'pastrami' in sandwich_orders: sandwich_orders.remove('pastrami') # Loop through the orders and make them for sandwich in sandwich_orders: print(f"I finished your {sandwich} sandwich. \n") finished_sandwiches.append(sandwich) print(finished_sandwiches) #7-10 Polling users about dream vacations # Set a flag so we can break when flag is False flag = True # Dictionary to store users name and dream vacation location dream_vacations = {} while flag: name = input("\nWhat is your name? ") destination = input("Where is your dream vacation location? ") dream_vacations[name] = destination poll_again = input("Would you like to poll another person? (yes/no)") if poll_again == 'no': flag = False print("- - - Results - - -") for name, location in dream_vacations.items(): print(f"{name.title()} would go to {location}.")
sandwich_orders = ['ham', 'bologna', 'pastrami', 'cheese', 'blt', 'pastrami', 'turkey', 'pastrami'] finished_sandwiches = [] print('\nThe deli is out of pastrami sandwiches.') while 'pastrami' in sandwich_orders: sandwich_orders.remove('pastrami') for sandwich in sandwich_orders: print(f'I finished your {sandwich} sandwich. \n') finished_sandwiches.append(sandwich) print(finished_sandwiches) flag = True dream_vacations = {} while flag: name = input('\nWhat is your name? ') destination = input('Where is your dream vacation location? ') dream_vacations[name] = destination poll_again = input('Would you like to poll another person? (yes/no)') if poll_again == 'no': flag = False print('- - - Results - - -') for (name, location) in dream_vacations.items(): print(f'{name.title()} would go to {location}.')
''' --- Part Two --- The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria. Using the above example again, the three entries that sum to 2020 are 979, 366, and 675. Multiplying them together produces the answer, 241861950. In your expense report, what is the product of the three entries that sum to 2020? ''' # abrir y leer archivo f = open ('input.txt','r') mensaje = f.read() f.close() list_numbers = mensaje.split('\n') for i in list_numbers: for j in list_numbers: for k in list_numbers: if(int(i)+int(j)+int(k)==2020): print(int(i)*int(j)*int(k))
""" --- Part Two --- The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria. Using the above example again, the three entries that sum to 2020 are 979, 366, and 675. Multiplying them together produces the answer, 241861950. In your expense report, what is the product of the three entries that sum to 2020? """ f = open('input.txt', 'r') mensaje = f.read() f.close() list_numbers = mensaje.split('\n') for i in list_numbers: for j in list_numbers: for k in list_numbers: if int(i) + int(j) + int(k) == 2020: print(int(i) * int(j) * int(k))
#http://code.activestate.com/recipes/52219-associating-multiple-values-with-each-key-in-a-dic/ #https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s06.html def repeatedValue(): # this method allows duplicate values for the same key d = dict() # To add a key->value pair, do this: #d.setdefault(key, []).append(value) d.setdefault('a',[]).append('apple') d.setdefault('b',[]).append('ball') d.setdefault('c',[]).append('cat') d.setdefault('a',[]).append('aeroplane') d.setdefault('a',[]).append('anar') d.setdefault('b',[]).append('balloon') #aval = d['a'] print(d) d['a'].remove('apple') print(d) def nonRepeatedValue(): example = {} example.setdefault('a', set()).add('apple') example.setdefault('b', set()).add('ball') example.setdefault('a', set()).add('ant') #example.setdefault('a', set()).add('apple') #example.setdefault('c', {})['cat']=1 #example.setdefault('a', {})['ant']=1 #example.setdefault('a', {})['apple']=1 print(example) d = example['a'] print(d) if __name__ == '__main__': #repeatedValue() nonRepeatedValue()
def repeated_value(): d = dict() d.setdefault('a', []).append('apple') d.setdefault('b', []).append('ball') d.setdefault('c', []).append('cat') d.setdefault('a', []).append('aeroplane') d.setdefault('a', []).append('anar') d.setdefault('b', []).append('balloon') print(d) d['a'].remove('apple') print(d) def non_repeated_value(): example = {} example.setdefault('a', set()).add('apple') example.setdefault('b', set()).add('ball') example.setdefault('a', set()).add('ant') print(example) d = example['a'] print(d) if __name__ == '__main__': non_repeated_value()
""" Tools for managing a federated Carbon cluster. """ class CarbonateException(Exception): pass
""" Tools for managing a federated Carbon cluster. """ class Carbonateexception(Exception): pass
STATUS_ACTIVE = 1 STATUS_INACTIVE = 2 STATUS_PENDING = 3 STATUS_FAILED = 9 STATUS_DONE = 10 STATUS_DELETED = 11 STATUS_FLOW_OPEN = 1 STATUS_FLOW_PROCESSING = 2 STATUS_FLOW_PROCESSED = 3 STATUS_FLOW_COMMITTED = 4 STATUS_FLOW_ABORTED = 11 TAP_ACCESS_PUBLIC = 1 TAP_ACCESS_SUBSCRIBERS = 2 TAP_ACCESS_PRIVATE = 3 DATA_STATE_NOT_MATERIALIZED = 1 DATA_STATE_MATERIALIZED = 2 DATA_STATE_READ_ONLY = 3 DATA_STATE_REQUEST_REBUILD = 4 DATA_STATE_REBUILDING = 5 DATA_STATE_REQUEST_TRUNCATE = 6 TRX_TYPE_FLOW = 1 TRX_TYPE_CREDIT = 2 FLOW_UPLOAD = 1 FLOW_DOWNLOAD = 3 TAG_ENTITY_TYPE = 1 TAG_PRIVACY_TYPE = 2 TAG_FEED_TYPE = 3 DISPLAY_MODE_BUYER = 1 DISPLAY_MODE_SELLER = 2 DISPLAY_MODE_FULL = 3
status_active = 1 status_inactive = 2 status_pending = 3 status_failed = 9 status_done = 10 status_deleted = 11 status_flow_open = 1 status_flow_processing = 2 status_flow_processed = 3 status_flow_committed = 4 status_flow_aborted = 11 tap_access_public = 1 tap_access_subscribers = 2 tap_access_private = 3 data_state_not_materialized = 1 data_state_materialized = 2 data_state_read_only = 3 data_state_request_rebuild = 4 data_state_rebuilding = 5 data_state_request_truncate = 6 trx_type_flow = 1 trx_type_credit = 2 flow_upload = 1 flow_download = 3 tag_entity_type = 1 tag_privacy_type = 2 tag_feed_type = 3 display_mode_buyer = 1 display_mode_seller = 2 display_mode_full = 3
# The following is just an example used in class. The actual code is below: # running = True # while running: # # try: # query = input('Enter 1 to search phonebook, enter 2 to quit: ') # except ValueError: # print('Imput must be a number. Please try again.') # continue # # if query == '1': # print('Thank you.') # elif query == '2': # quit() # else: # print('I did not understand that') # PHONEBOOK LAB phonebook = {'Katie': {'name': 'Katie', 'number': '2109415792', 'phrase': 'friend'}, 'Charlie': {'name': 'Charlie', 'number': '504699679', 'phrase': 'neighbor'}, 'Chelsea': {'name': 'Chelsea', 'number': '2109415778', 'phrase': 'sister'}, 'James': {'name': 'James', 'number': '5689412374', 'phrase': 'son'}} running = True while running: try: query = int(input('Enter 1 to create a contact, 2 to retrieve contact, 3 to update contact and 4 to delete contact: ')) except ValueError: print('Imput must be a number. Please try again.') continue if query == 1: add_name = str(input('Enter a name: ')).capitalize() add_number = str(input('Enter a number: ')) add_phrase = str(input('Enter a phrase: ')) newdictionary = {'name': add_name, 'number': add_number, 'add_phrase': add_phrase} phonebook.update(newdictionary) print('Your new contact has been created successfully: ' + str(newdictionary.values())) elif query == 2: print('These are your options: ' + str(phonebook.keys())) name = (str(input('Which contact do you want to retrieve? '))).capitalize() if name in phonebook: print(phonebook[name]) else: print('There is no such name. Try again.') elif query == 3: upd_name = str(input('What name would you like to update? ')).capitalize() del phonebook[upd_name] new_name = str(input('Enter a name: ')).capitalize() new_number = str(input('Enter a number: ')) new_phrase = str(input('Enter a phrase: ')) upd_dictionary = {'name': new_name, 'number': new_number, 'add_phrase': new_phrase} phonebook.update(upd_dictionary) print('Your contact has been updated successfully: ' + str(upd_dictionary.values())) elif query == 4: del_name = str(input('Which name would you like to delete?')) del phonebook[del_name] print(phonebook) else: print('Incorrect value. Please try again.')
phonebook = {'Katie': {'name': 'Katie', 'number': '2109415792', 'phrase': 'friend'}, 'Charlie': {'name': 'Charlie', 'number': '504699679', 'phrase': 'neighbor'}, 'Chelsea': {'name': 'Chelsea', 'number': '2109415778', 'phrase': 'sister'}, 'James': {'name': 'James', 'number': '5689412374', 'phrase': 'son'}} running = True while running: try: query = int(input('Enter 1 to create a contact, 2 to retrieve contact, 3 to update contact and 4 to delete contact: ')) except ValueError: print('Imput must be a number. Please try again.') continue if query == 1: add_name = str(input('Enter a name: ')).capitalize() add_number = str(input('Enter a number: ')) add_phrase = str(input('Enter a phrase: ')) newdictionary = {'name': add_name, 'number': add_number, 'add_phrase': add_phrase} phonebook.update(newdictionary) print('Your new contact has been created successfully: ' + str(newdictionary.values())) elif query == 2: print('These are your options: ' + str(phonebook.keys())) name = str(input('Which contact do you want to retrieve? ')).capitalize() if name in phonebook: print(phonebook[name]) else: print('There is no such name. Try again.') elif query == 3: upd_name = str(input('What name would you like to update? ')).capitalize() del phonebook[upd_name] new_name = str(input('Enter a name: ')).capitalize() new_number = str(input('Enter a number: ')) new_phrase = str(input('Enter a phrase: ')) upd_dictionary = {'name': new_name, 'number': new_number, 'add_phrase': new_phrase} phonebook.update(upd_dictionary) print('Your contact has been updated successfully: ' + str(upd_dictionary.values())) elif query == 4: del_name = str(input('Which name would you like to delete?')) del phonebook[del_name] print(phonebook) else: print('Incorrect value. Please try again.')
class ParticleSettingsTextureSlot: clump_factor = None damp_factor = None density_factor = None field_factor = None gravity_factor = None kink_amp_factor = None kink_freq_factor = None length_factor = None life_factor = None mapping = None mapping_x = None mapping_y = None mapping_z = None object = None rough_factor = None size_factor = None texture_coords = None time_factor = None use_map_clump = None use_map_damp = None use_map_density = None use_map_field = None use_map_gravity = None use_map_kink_amp = None use_map_kink_freq = None use_map_length = None use_map_life = None use_map_rough = None use_map_size = None use_map_time = None use_map_velocity = None uv_layer = None velocity_factor = None
class Particlesettingstextureslot: clump_factor = None damp_factor = None density_factor = None field_factor = None gravity_factor = None kink_amp_factor = None kink_freq_factor = None length_factor = None life_factor = None mapping = None mapping_x = None mapping_y = None mapping_z = None object = None rough_factor = None size_factor = None texture_coords = None time_factor = None use_map_clump = None use_map_damp = None use_map_density = None use_map_field = None use_map_gravity = None use_map_kink_amp = None use_map_kink_freq = None use_map_length = None use_map_life = None use_map_rough = None use_map_size = None use_map_time = None use_map_velocity = None uv_layer = None velocity_factor = None
# Some globals gane defaults DEFAULT_DICE_SIDES_NUMBER = 6 # Nb of side of the Dices SCORING_DICE_VALUE = [1, 5] # List of the side values of the dice who trigger a standard score SCORING_MULTIPLIER = [100, 50] # List of multiplier for standard score THRESHOLD_BONUS = 3 # Threshold of the triggering for bonus in term of occurrence of the same slide value STD_BONUS_MULTIPLIER = 100 # Standard multiplier for bonus ACE_BONUS_MULTIPLIER = 1000 # Special multiplier for ace bonus DEFAULT_DICES_NUMBER = 5 # Number of dices by default in the set
default_dice_sides_number = 6 scoring_dice_value = [1, 5] scoring_multiplier = [100, 50] threshold_bonus = 3 std_bonus_multiplier = 100 ace_bonus_multiplier = 1000 default_dices_number = 5
# # PySNMP MIB module HP-ICF-INST-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-INST-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:34:11 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection") hpSwitch, = mibBuilder.importSymbols("HP-ICF-OID", "hpSwitch") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") Bits, TimeTicks, Counter32, Counter64, MibIdentifier, Unsigned32, NotificationType, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, IpAddress, Integer32, iso, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "TimeTicks", "Counter32", "Counter64", "MibIdentifier", "Unsigned32", "NotificationType", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "IpAddress", "Integer32", "iso", "ObjectIdentity") TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue") hpicfInstMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45)) hpicfInstMIB.setRevisions(('2007-09-07 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hpicfInstMIB.setRevisionsDescriptions(('Initial revision.',)) if mibBuilder.loadTexts: hpicfInstMIB.setLastUpdated('200709070000Z') if mibBuilder.loadTexts: hpicfInstMIB.setOrganization('HP Networking') if mibBuilder.loadTexts: hpicfInstMIB.setContactInfo('Hewlett-Packard Company 8000 Foothills Blvd. Roseville, CA 95747') if mibBuilder.loadTexts: hpicfInstMIB.setDescription('This MIB module contains HP proprietary definitions for Instrumentation.') hpicfInstObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1)) hpicfInstConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2)) hpicfInstGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 1)) hpicfInstCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 2)) hpicfInstEnable = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 1), TruthValue().clone('true')).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstEnable.setStatus('current') if mibBuilder.loadTexts: hpicfInstEnable.setDescription('The operational status of Instrumentation on this switch.') hpicfInstMaxMemMB = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 2), Integer32().clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfInstMaxMemMB.setStatus('current') if mibBuilder.loadTexts: hpicfInstMaxMemMB.setDescription('The maximum memory that can be used by Instrumentation, in megabytes.') hpicfInstParameterTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3), ) if mibBuilder.loadTexts: hpicfInstParameterTable.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterTable.setDescription('Values of monitored instrumentation parameters.') hpicfInstParameterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1), ).setIndexNames((0, "HP-ICF-INST-MIB", "hpicfInstParameterIndex"), (0, "HP-ICF-INST-MIB", "hpicfInstInterfaceIndex"), (0, "HP-ICF-INST-MIB", "hpicfInstIntervalIndex")) if mibBuilder.loadTexts: hpicfInstParameterEntry.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterEntry.setDescription('An entry in the hpicfInstParameterTable.') hpicfInstParameterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstParameterIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterIndex.setDescription('The index of the parameter.') hpicfInstInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstInterfaceIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstInterfaceIndex.setDescription('Interface index i.e. port number for per port parameters and 0 for global parameters.') hpicfInstIntervalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstIntervalIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstIntervalIndex.setDescription('The index of the interval.') hpicfInstParameterName = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstParameterName.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterName.setDescription('The name of the parameter.') hpicfInstIntervalName = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstIntervalName.setStatus('current') if mibBuilder.loadTexts: hpicfInstIntervalName.setDescription('The name of the interval.') hpicfInstParameterValue = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstParameterValue.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterValue.setDescription('The current parameter value for the given interface and interval.') hpicfInstParamValMin = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstParamValMin.setStatus('current') if mibBuilder.loadTexts: hpicfInstParamValMin.setDescription('The minimum value of the parameter for the given interface and interval.') hpicfInstParamValMax = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfInstParamValMax.setStatus('current') if mibBuilder.loadTexts: hpicfInstParamValMax.setDescription('The maximum value of the parameter for the given interface and interval.') hpicfInstBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 1, 2)).setObjects(("HP-ICF-INST-MIB", "hpicfInstEnable"), ("HP-ICF-INST-MIB", "hpicfInstMaxMemMB"), ("HP-ICF-INST-MIB", "hpicfInstParameterName"), ("HP-ICF-INST-MIB", "hpicfInstIntervalName"), ("HP-ICF-INST-MIB", "hpicfInstParameterValue"), ("HP-ICF-INST-MIB", "hpicfInstParamValMin"), ("HP-ICF-INST-MIB", "hpicfInstParamValMax")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfInstBaseGroup = hpicfInstBaseGroup.setStatus('current') if mibBuilder.loadTexts: hpicfInstBaseGroup.setDescription('A collection of objects to support basic Instrumentation configuration on HP switches.') hpicfInstBaseCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 2, 1)).setObjects(("HP-ICF-INST-MIB", "hpicfInstBaseGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfInstBaseCompliance = hpicfInstBaseCompliance.setStatus('current') if mibBuilder.loadTexts: hpicfInstBaseCompliance.setDescription('The compliance statement for HP switches running Instrumentation and implementing the HP-ICF-INST MIB.') mibBuilder.exportSymbols("HP-ICF-INST-MIB", hpicfInstIntervalIndex=hpicfInstIntervalIndex, hpicfInstEnable=hpicfInstEnable, hpicfInstBaseGroup=hpicfInstBaseGroup, hpicfInstCompliances=hpicfInstCompliances, hpicfInstParameterEntry=hpicfInstParameterEntry, hpicfInstConformance=hpicfInstConformance, hpicfInstParameterName=hpicfInstParameterName, hpicfInstBaseCompliance=hpicfInstBaseCompliance, hpicfInstInterfaceIndex=hpicfInstInterfaceIndex, hpicfInstParamValMax=hpicfInstParamValMax, hpicfInstParameterTable=hpicfInstParameterTable, hpicfInstGroups=hpicfInstGroups, hpicfInstObjects=hpicfInstObjects, hpicfInstMaxMemMB=hpicfInstMaxMemMB, hpicfInstParameterValue=hpicfInstParameterValue, hpicfInstIntervalName=hpicfInstIntervalName, PYSNMP_MODULE_ID=hpicfInstMIB, hpicfInstMIB=hpicfInstMIB, hpicfInstParamValMin=hpicfInstParamValMin, hpicfInstParameterIndex=hpicfInstParameterIndex)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, constraints_union, value_range_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection') (hp_switch,) = mibBuilder.importSymbols('HP-ICF-OID', 'hpSwitch') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (bits, time_ticks, counter32, counter64, mib_identifier, unsigned32, notification_type, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, ip_address, integer32, iso, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'TimeTicks', 'Counter32', 'Counter64', 'MibIdentifier', 'Unsigned32', 'NotificationType', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'IpAddress', 'Integer32', 'iso', 'ObjectIdentity') (textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue') hpicf_inst_mib = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45)) hpicfInstMIB.setRevisions(('2007-09-07 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hpicfInstMIB.setRevisionsDescriptions(('Initial revision.',)) if mibBuilder.loadTexts: hpicfInstMIB.setLastUpdated('200709070000Z') if mibBuilder.loadTexts: hpicfInstMIB.setOrganization('HP Networking') if mibBuilder.loadTexts: hpicfInstMIB.setContactInfo('Hewlett-Packard Company 8000 Foothills Blvd. Roseville, CA 95747') if mibBuilder.loadTexts: hpicfInstMIB.setDescription('This MIB module contains HP proprietary definitions for Instrumentation.') hpicf_inst_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1)) hpicf_inst_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2)) hpicf_inst_groups = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 1)) hpicf_inst_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 2)) hpicf_inst_enable = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 1), truth_value().clone('true')).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstEnable.setStatus('current') if mibBuilder.loadTexts: hpicfInstEnable.setDescription('The operational status of Instrumentation on this switch.') hpicf_inst_max_mem_mb = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 2), integer32().clone(2)).setMaxAccess('readwrite') if mibBuilder.loadTexts: hpicfInstMaxMemMB.setStatus('current') if mibBuilder.loadTexts: hpicfInstMaxMemMB.setDescription('The maximum memory that can be used by Instrumentation, in megabytes.') hpicf_inst_parameter_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3)) if mibBuilder.loadTexts: hpicfInstParameterTable.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterTable.setDescription('Values of monitored instrumentation parameters.') hpicf_inst_parameter_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1)).setIndexNames((0, 'HP-ICF-INST-MIB', 'hpicfInstParameterIndex'), (0, 'HP-ICF-INST-MIB', 'hpicfInstInterfaceIndex'), (0, 'HP-ICF-INST-MIB', 'hpicfInstIntervalIndex')) if mibBuilder.loadTexts: hpicfInstParameterEntry.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterEntry.setDescription('An entry in the hpicfInstParameterTable.') hpicf_inst_parameter_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstParameterIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterIndex.setDescription('The index of the parameter.') hpicf_inst_interface_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstInterfaceIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstInterfaceIndex.setDescription('Interface index i.e. port number for per port parameters and 0 for global parameters.') hpicf_inst_interval_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))) if mibBuilder.loadTexts: hpicfInstIntervalIndex.setStatus('current') if mibBuilder.loadTexts: hpicfInstIntervalIndex.setDescription('The index of the interval.') hpicf_inst_parameter_name = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstParameterName.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterName.setDescription('The name of the parameter.') hpicf_inst_interval_name = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstIntervalName.setStatus('current') if mibBuilder.loadTexts: hpicfInstIntervalName.setDescription('The name of the interval.') hpicf_inst_parameter_value = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 6), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstParameterValue.setStatus('current') if mibBuilder.loadTexts: hpicfInstParameterValue.setDescription('The current parameter value for the given interface and interval.') hpicf_inst_param_val_min = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstParamValMin.setStatus('current') if mibBuilder.loadTexts: hpicfInstParamValMin.setDescription('The minimum value of the parameter for the given interface and interval.') hpicf_inst_param_val_max = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 1, 3, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: hpicfInstParamValMax.setStatus('current') if mibBuilder.loadTexts: hpicfInstParamValMax.setDescription('The maximum value of the parameter for the given interface and interval.') hpicf_inst_base_group = object_group((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 1, 2)).setObjects(('HP-ICF-INST-MIB', 'hpicfInstEnable'), ('HP-ICF-INST-MIB', 'hpicfInstMaxMemMB'), ('HP-ICF-INST-MIB', 'hpicfInstParameterName'), ('HP-ICF-INST-MIB', 'hpicfInstIntervalName'), ('HP-ICF-INST-MIB', 'hpicfInstParameterValue'), ('HP-ICF-INST-MIB', 'hpicfInstParamValMin'), ('HP-ICF-INST-MIB', 'hpicfInstParamValMax')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_inst_base_group = hpicfInstBaseGroup.setStatus('current') if mibBuilder.loadTexts: hpicfInstBaseGroup.setDescription('A collection of objects to support basic Instrumentation configuration on HP switches.') hpicf_inst_base_compliance = module_compliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 45, 2, 2, 1)).setObjects(('HP-ICF-INST-MIB', 'hpicfInstBaseGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicf_inst_base_compliance = hpicfInstBaseCompliance.setStatus('current') if mibBuilder.loadTexts: hpicfInstBaseCompliance.setDescription('The compliance statement for HP switches running Instrumentation and implementing the HP-ICF-INST MIB.') mibBuilder.exportSymbols('HP-ICF-INST-MIB', hpicfInstIntervalIndex=hpicfInstIntervalIndex, hpicfInstEnable=hpicfInstEnable, hpicfInstBaseGroup=hpicfInstBaseGroup, hpicfInstCompliances=hpicfInstCompliances, hpicfInstParameterEntry=hpicfInstParameterEntry, hpicfInstConformance=hpicfInstConformance, hpicfInstParameterName=hpicfInstParameterName, hpicfInstBaseCompliance=hpicfInstBaseCompliance, hpicfInstInterfaceIndex=hpicfInstInterfaceIndex, hpicfInstParamValMax=hpicfInstParamValMax, hpicfInstParameterTable=hpicfInstParameterTable, hpicfInstGroups=hpicfInstGroups, hpicfInstObjects=hpicfInstObjects, hpicfInstMaxMemMB=hpicfInstMaxMemMB, hpicfInstParameterValue=hpicfInstParameterValue, hpicfInstIntervalName=hpicfInstIntervalName, PYSNMP_MODULE_ID=hpicfInstMIB, hpicfInstMIB=hpicfInstMIB, hpicfInstParamValMin=hpicfInstParamValMin, hpicfInstParameterIndex=hpicfInstParameterIndex)
class Constants: # Constants related to the core physics of the game FIELD_LENGTH = 1800 FIELD_HEIGHT = 800 BALL_RADIUS = 8 NUM_PLAYERS = 5 GAME_LENGTH = 1800 GOAL_WIDTH = 20 MAX_BALL_VELOCITY = 10 MAX_PLAYER_VELOCITY = 5 NUM_PLAYERS = 5 PLAYER_RADIUS = 24 STARTING_POSITIONS = [[[200, 200], [200, 400], [500, 200], [500, 400], [800, 300]], [[1600, 200], [1600, 400], [1300, 200], [1300, 400], [1000, 300]]]
class Constants: field_length = 1800 field_height = 800 ball_radius = 8 num_players = 5 game_length = 1800 goal_width = 20 max_ball_velocity = 10 max_player_velocity = 5 num_players = 5 player_radius = 24 starting_positions = [[[200, 200], [200, 400], [500, 200], [500, 400], [800, 300]], [[1600, 200], [1600, 400], [1300, 200], [1300, 400], [1000, 300]]]
class Layer: def __init__(self, name, parent): self.name = name self.parent = parent self.children = [] def add_child(self, child): self.children.append(child)
class Layer: def __init__(self, name, parent): self.name = name self.parent = parent self.children = [] def add_child(self, child): self.children.append(child)
# Answer 1. listy = [1,5,6,4,1,2,3,5] sub_list = [1,1,5] # print("Original List :" + str(listy)) # print("Original sub_list : " + str(sub_list)) flag = 0 # if(all(x in listy for x in sub_list)): # flag = 1 if (set(sub_list).issubset(set(listy))): flag = 1 if (flag): print("It's a Match") else: print("It's Gone") # Answer 2. def checkPrimeNumbers(num): # for num in range(2,2500): count = 0 for i in range(2,num): if num%i == 0: count = 1 if (count == 0): # print(num, "Prime no.") return True else: return False lst = list(range(1,2500)) isPrime = filter(checkPrimeNumbers, lst) print("prime numbers between 1 - 2500:", list(isPrime)) # Answer 3) def getCapitalize(*arg): for word in arg: string = word.split(" ") capitalized_list = [capital.capitalize() for capital in string] words = (" ").join(capitalized_list) print(words) getCapitalize("hey this is sai","I am in mumbai","teaching is my passion")
listy = [1, 5, 6, 4, 1, 2, 3, 5] sub_list = [1, 1, 5] flag = 0 if set(sub_list).issubset(set(listy)): flag = 1 if flag: print("It's a Match") else: print("It's Gone") def check_prime_numbers(num): count = 0 for i in range(2, num): if num % i == 0: count = 1 if count == 0: return True else: return False lst = list(range(1, 2500)) is_prime = filter(checkPrimeNumbers, lst) print('prime numbers between 1 - 2500:', list(isPrime)) def get_capitalize(*arg): for word in arg: string = word.split(' ') capitalized_list = [capital.capitalize() for capital in string] words = ' '.join(capitalized_list) print(words) get_capitalize('hey this is sai', 'I am in mumbai', 'teaching is my passion')
def event_handler(obj, event): if event == lv.EVENT.VALUE_CHANGED: print("State: %s" % ("Checked" if obj.is_checked() else "Unchecked")) cb = lv.cb(lv.scr_act()) cb.set_text("I agree to terms and conditions.") cb.align(None, lv.ALIGN.CENTER, 0, 0) cb.set_event_cb(event_handler)
def event_handler(obj, event): if event == lv.EVENT.VALUE_CHANGED: print('State: %s' % ('Checked' if obj.is_checked() else 'Unchecked')) cb = lv.cb(lv.scr_act()) cb.set_text('I agree to terms and conditions.') cb.align(None, lv.ALIGN.CENTER, 0, 0) cb.set_event_cb(event_handler)
K, X = map(int, input().split()) out_list = [] for i in range(X-(K-1), X+(K)): out_list.append(str(i)) print(" ".join(out_list))
(k, x) = map(int, input().split()) out_list = [] for i in range(X - (K - 1), X + K): out_list.append(str(i)) print(' '.join(out_list))
"""BoilerplatePython. https://boilerplatepython.readthedocs.io/ https://github.com/Robpol86/boilerplatepython https://pypi.org/project/boilerplatepython """ __author__ = "@Robpol86" __license__ = "BSD-2-Clause" __version__ = "0.0.1"
"""BoilerplatePython. https://boilerplatepython.readthedocs.io/ https://github.com/Robpol86/boilerplatepython https://pypi.org/project/boilerplatepython """ __author__ = '@Robpol86' __license__ = 'BSD-2-Clause' __version__ = '0.0.1'
""" Header class, a dictionary that contains information about the file content """ class Header(dict): """ Header class, a dictionary that contains information about the file content """ def is_proper(self): "Whether it is an header created by lyncs_io" return "_lyncs_io" in self
""" Header class, a dictionary that contains information about the file content """ class Header(dict): """ Header class, a dictionary that contains information about the file content """ def is_proper(self): """Whether it is an header created by lyncs_io""" return '_lyncs_io' in self
class Solution: def minimumEffort(self, tasks: List[List[int]]) -> int: tasks.sort(key=lambda x: x[1]-x[0]) answer=0 for actual, req in tasks: answer=max(answer+actual,req) return answer
class Solution: def minimum_effort(self, tasks: List[List[int]]) -> int: tasks.sort(key=lambda x: x[1] - x[0]) answer = 0 for (actual, req) in tasks: answer = max(answer + actual, req) return answer
class ParserMeta(type): registry = {} def __new__(cls, name, bases, ns): result = type.__new__(cls, name, bases, ns) if name != 'Parser': domains = ns['domains'] for domain in domains: cls.registry[domain] = result return result class UnknownParser: @staticmethod def normalize_url(url): return url @staticmethod def get_title(url): # TODO: load URL, extract <title> tag return '' def get_parser(domain): return ParserMeta.registry.get(domain, UnknownParser) class Parser(metaclass=ParserMeta): pass class YouTube(Parser): domains = ['youtube.com', 'youtube.de'] @staticmethod def normalize_url(url): pass @staticmethod def get_title(url): pass class BandCamp(Parser): domains = ['bandcamp.com'] @staticmethod def normalize_url(url): pass @staticmethod def get_title(url): pass if __name__ == '__main__': print(get_parser('youtube.com')) print(get_parser('bandcamp.com')) print(get_parser('meine-band.de'))
class Parsermeta(type): registry = {} def __new__(cls, name, bases, ns): result = type.__new__(cls, name, bases, ns) if name != 'Parser': domains = ns['domains'] for domain in domains: cls.registry[domain] = result return result class Unknownparser: @staticmethod def normalize_url(url): return url @staticmethod def get_title(url): return '' def get_parser(domain): return ParserMeta.registry.get(domain, UnknownParser) class Parser(metaclass=ParserMeta): pass class Youtube(Parser): domains = ['youtube.com', 'youtube.de'] @staticmethod def normalize_url(url): pass @staticmethod def get_title(url): pass class Bandcamp(Parser): domains = ['bandcamp.com'] @staticmethod def normalize_url(url): pass @staticmethod def get_title(url): pass if __name__ == '__main__': print(get_parser('youtube.com')) print(get_parser('bandcamp.com')) print(get_parser('meine-band.de'))
""":mod:`wand.exceptions` --- Errors and warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module maps MagickWand API's errors and warnings to Python's native exceptions and warnings. You can catch all MagickWand errors using Python's natural way to catch errors. .. seealso:: `ImageMagick Exceptions <http://www.imagemagick.org/script/exception.php>`_ .. versionadded:: 0.1.1 .. versionchanged:: 0.5.8 Warning & Error Exceptions are now explicitly defined. Previously ImageMagick domain-based errors were dynamically generated at runtime. """ class WandException(Exception): """All Wand-related exceptions are derived from this class.""" class BaseWarning(WandException, Warning): """Base class for Wand-related warnings. .. versionadded:: 0.4.4 """ class BaseError(WandException): """Base class for Wand-related errors. .. versionadded:: 0.4.4 """ class BaseFatalError(WandException): """Base class for Wand-related fatal errors. .. versionadded:: 0.4.4 """ class WandLibraryVersionError(WandException): """Base class for Wand-related ImageMagick version errors. .. versionadded:: 0.3.2 """ class WandRuntimeError(WandException, RuntimeError): """Generic class for Wand-related runtime errors. .. versionadded:: 0.5.2 """ class ResourceLimitWarning(BaseWarning, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 300 class ResourceLimitError(BaseError, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 400 class ResourceLimitFatalError(BaseFatalError, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 700 class TypeWarning(BaseWarning): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 305 class TypeError(BaseError): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 405 class TypeFatalError(BaseFatalError): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 705 class OptionWarning(BaseWarning): """A command-line option was malformed.""" wand_error_code = 310 class OptionError(BaseError): """A command-line option was malformed.""" wand_error_code = 410 class OptionFatalError(BaseFatalError): """A command-line option was malformed.""" wand_error_code = 710 class DelegateWarning(BaseWarning): """An ImageMagick delegate failed to complete.""" wand_error_code = 315 class DelegateError(BaseError): """An ImageMagick delegate failed to complete.""" wand_error_code = 415 class DelegateFatalError(BaseFatalError): """An ImageMagick delegate failed to complete.""" wand_error_code = 715 class MissingDelegateWarning(BaseWarning, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 320 class MissingDelegateError(BaseError, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 420 class MissingDelegateFatalError(BaseFatalError, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 720 class CorruptImageWarning(BaseWarning, ValueError): """The image file may be corrupt.""" wand_error_code = 325 class CorruptImageError(BaseError, ValueError): """The image file may be corrupt.""" wand_error_code = 425 class CorruptImageFatalError(BaseFatalError, ValueError): """The image file may be corrupt.""" wand_error_code = 725 class FileOpenWarning(BaseWarning, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 330 class FileOpenError(BaseError, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 430 class FileOpenFatalError(BaseFatalError, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 730 class BlobWarning(BaseWarning, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 335 class BlobError(BaseError, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 435 class BlobFatalError(BaseFatalError, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 735 class StreamWarning(BaseWarning, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 340 class StreamError(BaseError, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 440 class StreamFatalError(BaseFatalError, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 740 class CacheWarning(BaseWarning): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 345 class CacheError(BaseError): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 445 class CacheFatalError(BaseFatalError): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 745 class CoderWarning(BaseWarning): """There was a problem with an image coder.""" wand_error_code = 350 class CoderError(BaseError): """There was a problem with an image coder.""" wand_error_code = 450 class CoderFatalError(BaseFatalError): """There was a problem with an image coder.""" wand_error_code = 750 class ModuleWarning(BaseWarning): """There was a problem with an image module.""" wand_error_code = 355 class ModuleError(BaseError): """There was a problem with an image module.""" wand_error_code = 455 class ModuleFatalError(BaseFatalError): """There was a problem with an image module.""" wand_error_code = 755 class DrawWarning(BaseWarning): """A drawing operation failed.""" wand_error_code = 360 class DrawError(BaseError): """A drawing operation failed.""" wand_error_code = 460 class DrawFatalError(BaseFatalError): """A drawing operation failed.""" wand_error_code = 760 class ImageWarning(BaseWarning): """The operation could not complete due to an incompatible image.""" wand_error_code = 365 class ImageError(BaseError): """The operation could not complete due to an incompatible image.""" wand_error_code = 465 class ImageFatalError(BaseFatalError): """The operation could not complete due to an incompatible image.""" wand_error_code = 765 class WandWarning(BaseWarning): """There was a problem specific to the MagickWand API.""" wand_error_code = 370 class WandError(BaseError): """There was a problem specific to the MagickWand API.""" wand_error_code = 470 class WandFatalError(BaseFatalError): """There was a problem specific to the MagickWand API.""" wand_error_code = 770 class RandomWarning(BaseWarning): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 375 class RandomError(BaseError): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 475 class RandomFatalError(BaseFatalError): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 775 class XServerWarning(BaseWarning): """An X resource is unavailable.""" wand_error_code = 380 class XServerError(BaseError): """An X resource is unavailable.""" wand_error_code = 480 class XServerFatalError(BaseFatalError): """An X resource is unavailable.""" wand_error_code = 780 class MonitorWarning(BaseWarning): """There was a problem activating the progress monitor.""" wand_error_code = 385 class MonitorError(BaseError): """There was a problem activating the progress monitor.""" wand_error_code = 485 class MonitorFatalError(BaseFatalError): """There was a problem activating the progress monitor.""" wand_error_code = 785 class RegistryWarning(BaseWarning): """There was a problem getting or setting the registry.""" wand_error_code = 390 class RegistryError(BaseError): """There was a problem getting or setting the registry.""" wand_error_code = 490 class RegistryFatalError(BaseFatalError): """There was a problem getting or setting the registry.""" wand_error_code = 790 class ConfigureWarning(BaseWarning): """There was a problem getting a configuration file.""" wand_error_code = 395 class ConfigureError(BaseError): """There was a problem getting a configuration file.""" wand_error_code = 495 class ConfigureFatalError(BaseFatalError): """There was a problem getting a configuration file.""" wand_error_code = 795 class PolicyWarning(BaseWarning): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 399 class PolicyError(BaseError): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 499 class PolicyFatalError(BaseFatalError): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 799 #: (:class:`dict`) The dictionary of (code, exc_type). TYPE_MAP = { 300: ResourceLimitWarning, 305: TypeWarning, 310: OptionWarning, 315: DelegateWarning, 320: MissingDelegateWarning, 325: CorruptImageWarning, 330: FileOpenWarning, 335: BlobWarning, 340: StreamWarning, 345: CacheWarning, 350: CoderWarning, 355: ModuleWarning, 360: DrawWarning, 365: ImageWarning, 370: WandWarning, 375: RandomWarning, 380: XServerWarning, 385: MonitorWarning, 390: RegistryWarning, 395: ConfigureWarning, 399: PolicyWarning, 400: ResourceLimitError, 405: TypeError, 410: OptionError, 415: DelegateError, 420: MissingDelegateError, 425: CorruptImageError, 430: FileOpenError, 435: BlobError, 440: StreamError, 445: CacheError, 450: CoderError, 455: ModuleError, 460: DrawError, 465: ImageError, 470: WandError, 475: RandomError, 480: XServerError, 485: MonitorError, 490: RegistryError, 495: ConfigureError, 499: PolicyError, 700: ResourceLimitFatalError, 705: TypeFatalError, 710: OptionFatalError, 715: DelegateFatalError, 720: MissingDelegateFatalError, 725: CorruptImageFatalError, 730: FileOpenFatalError, 735: BlobFatalError, 740: StreamFatalError, 745: CacheFatalError, 750: CoderFatalError, 755: ModuleFatalError, 760: DrawFatalError, 765: ImageFatalError, 770: WandFatalError, 775: RandomFatalError, 780: XServerFatalError, 785: MonitorFatalError, 790: RegistryFatalError, 795: ConfigureFatalError, 799: PolicyFatalError, }
""":mod:`wand.exceptions` --- Errors and warnings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module maps MagickWand API's errors and warnings to Python's native exceptions and warnings. You can catch all MagickWand errors using Python's natural way to catch errors. .. seealso:: `ImageMagick Exceptions <http://www.imagemagick.org/script/exception.php>`_ .. versionadded:: 0.1.1 .. versionchanged:: 0.5.8 Warning & Error Exceptions are now explicitly defined. Previously ImageMagick domain-based errors were dynamically generated at runtime. """ class Wandexception(Exception): """All Wand-related exceptions are derived from this class.""" class Basewarning(WandException, Warning): """Base class for Wand-related warnings. .. versionadded:: 0.4.4 """ class Baseerror(WandException): """Base class for Wand-related errors. .. versionadded:: 0.4.4 """ class Basefatalerror(WandException): """Base class for Wand-related fatal errors. .. versionadded:: 0.4.4 """ class Wandlibraryversionerror(WandException): """Base class for Wand-related ImageMagick version errors. .. versionadded:: 0.3.2 """ class Wandruntimeerror(WandException, RuntimeError): """Generic class for Wand-related runtime errors. .. versionadded:: 0.5.2 """ class Resourcelimitwarning(BaseWarning, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 300 class Resourcelimiterror(BaseError, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 400 class Resourcelimitfatalerror(BaseFatalError, MemoryError): """A program resource is exhausted e.g. not enough memory.""" wand_error_code = 700 class Typewarning(BaseWarning): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 305 class Typeerror(BaseError): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 405 class Typefatalerror(BaseFatalError): """A font is unavailable; a substitution may have occurred.""" wand_error_code = 705 class Optionwarning(BaseWarning): """A command-line option was malformed.""" wand_error_code = 310 class Optionerror(BaseError): """A command-line option was malformed.""" wand_error_code = 410 class Optionfatalerror(BaseFatalError): """A command-line option was malformed.""" wand_error_code = 710 class Delegatewarning(BaseWarning): """An ImageMagick delegate failed to complete.""" wand_error_code = 315 class Delegateerror(BaseError): """An ImageMagick delegate failed to complete.""" wand_error_code = 415 class Delegatefatalerror(BaseFatalError): """An ImageMagick delegate failed to complete.""" wand_error_code = 715 class Missingdelegatewarning(BaseWarning, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 320 class Missingdelegateerror(BaseError, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 420 class Missingdelegatefatalerror(BaseFatalError, ImportError): """The image type can not be read or written because the appropriate; delegate is missing.""" wand_error_code = 720 class Corruptimagewarning(BaseWarning, ValueError): """The image file may be corrupt.""" wand_error_code = 325 class Corruptimageerror(BaseError, ValueError): """The image file may be corrupt.""" wand_error_code = 425 class Corruptimagefatalerror(BaseFatalError, ValueError): """The image file may be corrupt.""" wand_error_code = 725 class Fileopenwarning(BaseWarning, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 330 class Fileopenerror(BaseError, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 430 class Fileopenfatalerror(BaseFatalError, IOError): """The image file could not be opened for reading or writing.""" wand_error_code = 730 class Blobwarning(BaseWarning, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 335 class Bloberror(BaseError, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 435 class Blobfatalerror(BaseFatalError, IOError): """A binary large object could not be allocated, read, or written.""" wand_error_code = 735 class Streamwarning(BaseWarning, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 340 class Streamerror(BaseError, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 440 class Streamfatalerror(BaseFatalError, IOError): """There was a problem reading or writing from a stream.""" wand_error_code = 740 class Cachewarning(BaseWarning): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 345 class Cacheerror(BaseError): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 445 class Cachefatalerror(BaseFatalError): """Pixels could not be read or written to the pixel cache.""" wand_error_code = 745 class Coderwarning(BaseWarning): """There was a problem with an image coder.""" wand_error_code = 350 class Codererror(BaseError): """There was a problem with an image coder.""" wand_error_code = 450 class Coderfatalerror(BaseFatalError): """There was a problem with an image coder.""" wand_error_code = 750 class Modulewarning(BaseWarning): """There was a problem with an image module.""" wand_error_code = 355 class Moduleerror(BaseError): """There was a problem with an image module.""" wand_error_code = 455 class Modulefatalerror(BaseFatalError): """There was a problem with an image module.""" wand_error_code = 755 class Drawwarning(BaseWarning): """A drawing operation failed.""" wand_error_code = 360 class Drawerror(BaseError): """A drawing operation failed.""" wand_error_code = 460 class Drawfatalerror(BaseFatalError): """A drawing operation failed.""" wand_error_code = 760 class Imagewarning(BaseWarning): """The operation could not complete due to an incompatible image.""" wand_error_code = 365 class Imageerror(BaseError): """The operation could not complete due to an incompatible image.""" wand_error_code = 465 class Imagefatalerror(BaseFatalError): """The operation could not complete due to an incompatible image.""" wand_error_code = 765 class Wandwarning(BaseWarning): """There was a problem specific to the MagickWand API.""" wand_error_code = 370 class Wanderror(BaseError): """There was a problem specific to the MagickWand API.""" wand_error_code = 470 class Wandfatalerror(BaseFatalError): """There was a problem specific to the MagickWand API.""" wand_error_code = 770 class Randomwarning(BaseWarning): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 375 class Randomerror(BaseError): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 475 class Randomfatalerror(BaseFatalError): """There is a problem generating a true or pseudo-random number.""" wand_error_code = 775 class Xserverwarning(BaseWarning): """An X resource is unavailable.""" wand_error_code = 380 class Xservererror(BaseError): """An X resource is unavailable.""" wand_error_code = 480 class Xserverfatalerror(BaseFatalError): """An X resource is unavailable.""" wand_error_code = 780 class Monitorwarning(BaseWarning): """There was a problem activating the progress monitor.""" wand_error_code = 385 class Monitorerror(BaseError): """There was a problem activating the progress monitor.""" wand_error_code = 485 class Monitorfatalerror(BaseFatalError): """There was a problem activating the progress monitor.""" wand_error_code = 785 class Registrywarning(BaseWarning): """There was a problem getting or setting the registry.""" wand_error_code = 390 class Registryerror(BaseError): """There was a problem getting or setting the registry.""" wand_error_code = 490 class Registryfatalerror(BaseFatalError): """There was a problem getting or setting the registry.""" wand_error_code = 790 class Configurewarning(BaseWarning): """There was a problem getting a configuration file.""" wand_error_code = 395 class Configureerror(BaseError): """There was a problem getting a configuration file.""" wand_error_code = 495 class Configurefatalerror(BaseFatalError): """There was a problem getting a configuration file.""" wand_error_code = 795 class Policywarning(BaseWarning): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 399 class Policyerror(BaseError): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 499 class Policyfatalerror(BaseFatalError): """A policy denies access to a delegate, coder, filter, path, or resource.""" wand_error_code = 799 type_map = {300: ResourceLimitWarning, 305: TypeWarning, 310: OptionWarning, 315: DelegateWarning, 320: MissingDelegateWarning, 325: CorruptImageWarning, 330: FileOpenWarning, 335: BlobWarning, 340: StreamWarning, 345: CacheWarning, 350: CoderWarning, 355: ModuleWarning, 360: DrawWarning, 365: ImageWarning, 370: WandWarning, 375: RandomWarning, 380: XServerWarning, 385: MonitorWarning, 390: RegistryWarning, 395: ConfigureWarning, 399: PolicyWarning, 400: ResourceLimitError, 405: TypeError, 410: OptionError, 415: DelegateError, 420: MissingDelegateError, 425: CorruptImageError, 430: FileOpenError, 435: BlobError, 440: StreamError, 445: CacheError, 450: CoderError, 455: ModuleError, 460: DrawError, 465: ImageError, 470: WandError, 475: RandomError, 480: XServerError, 485: MonitorError, 490: RegistryError, 495: ConfigureError, 499: PolicyError, 700: ResourceLimitFatalError, 705: TypeFatalError, 710: OptionFatalError, 715: DelegateFatalError, 720: MissingDelegateFatalError, 725: CorruptImageFatalError, 730: FileOpenFatalError, 735: BlobFatalError, 740: StreamFatalError, 745: CacheFatalError, 750: CoderFatalError, 755: ModuleFatalError, 760: DrawFatalError, 765: ImageFatalError, 770: WandFatalError, 775: RandomFatalError, 780: XServerFatalError, 785: MonitorFatalError, 790: RegistryFatalError, 795: ConfigureFatalError, 799: PolicyFatalError}
class Solution: def characterReplacement(self, s, k): """ :type s: str :type k: int :rtype: int """ dic, start, end = {}, 0, 0 for end in range(1, len(s)+1): if not s[end-1] in dic: dic[s[end-1]] = 1 else: dic[s[end-1]] += 1 if end-start-max(dic.values()) > k: dic[s[start]] -= 1 start += 1 return end-start
class Solution: def character_replacement(self, s, k): """ :type s: str :type k: int :rtype: int """ (dic, start, end) = ({}, 0, 0) for end in range(1, len(s) + 1): if not s[end - 1] in dic: dic[s[end - 1]] = 1 else: dic[s[end - 1]] += 1 if end - start - max(dic.values()) > k: dic[s[start]] -= 1 start += 1 return end - start
# Trabajando con ciclos for x = 1 y = 12 z = 2 print("Mi nombre es ") for item in range(x, y, z): print(f"@Mangusoft se repetira {item}") # if item == 3: # break
x = 1 y = 12 z = 2 print('Mi nombre es ') for item in range(x, y, z): print(f'@Mangusoft se repetira {item}')
class Symbol: def __init__( self, lexeme, type, category, value, scope, extends, implements, params ): self.__lexeme__ = lexeme self.__type__ = type self.__category__ = category self.__value__ = value self.__scope__ = scope self.__extends__ = extends self.__implements__ = implements self.__params__ = params @property def lexeme(self): return self.__lexeme__ @lexeme.setter def lexeme(self, lexeme): self.__lexeme__ = lexeme @property def type(self): return self.__type__ @type.setter def type(self, type): self.__type__ = type @property def category(self): return self.__category__ @category.setter def category(self, category): self.__category__ = category @property def value(self): return self.__value__ @value.setter def value(self, value): self.__value__ = value @property def scope(self): return self.__scope__ @scope.setter def scope(self, scope): self.__scope__ = scope @property def extends(self): return self.__extends__ @extends.setter def extends(self, extends): self.__extends__ = extends @property def implements(self): return self.__implements__ @implements.setter def implements(self, implements): self.__implements__ = implements @property def params(self): return self.__params__ @params.setter def params(self, params): self.__params__ = params
class Symbol: def __init__(self, lexeme, type, category, value, scope, extends, implements, params): self.__lexeme__ = lexeme self.__type__ = type self.__category__ = category self.__value__ = value self.__scope__ = scope self.__extends__ = extends self.__implements__ = implements self.__params__ = params @property def lexeme(self): return self.__lexeme__ @lexeme.setter def lexeme(self, lexeme): self.__lexeme__ = lexeme @property def type(self): return self.__type__ @type.setter def type(self, type): self.__type__ = type @property def category(self): return self.__category__ @category.setter def category(self, category): self.__category__ = category @property def value(self): return self.__value__ @value.setter def value(self, value): self.__value__ = value @property def scope(self): return self.__scope__ @scope.setter def scope(self, scope): self.__scope__ = scope @property def extends(self): return self.__extends__ @extends.setter def extends(self, extends): self.__extends__ = extends @property def implements(self): return self.__implements__ @implements.setter def implements(self, implements): self.__implements__ = implements @property def params(self): return self.__params__ @params.setter def params(self, params): self.__params__ = params
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param head: ListNode head is the head of the linked list @param m: An integer @param n: An integer @return: The head of the reversed ListNode """ def reverseBetween(self, head, m, n): i = 0 node = head if m == n: return head pre_node = None reverse_start = None while node: i += 1 next_node = node.next if i == m - 1: reverse_start = node if i == m: reverse_end = node pre_node = node if i > m and i < n: node.next = pre_node pre_node = node if i == n: node.next = pre_node reverse_end.next = next_node if reverse_start: reverse_start.next = node else: return node node = next_node return head
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param head: ListNode head is the head of the linked list @param m: An integer @param n: An integer @return: The head of the reversed ListNode """ def reverse_between(self, head, m, n): i = 0 node = head if m == n: return head pre_node = None reverse_start = None while node: i += 1 next_node = node.next if i == m - 1: reverse_start = node if i == m: reverse_end = node pre_node = node if i > m and i < n: node.next = pre_node pre_node = node if i == n: node.next = pre_node reverse_end.next = next_node if reverse_start: reverse_start.next = node else: return node node = next_node return head
# Implement a method tht accepts 3 integer values "a, b and c". # The method should return True if a triangle can be built with the sides of given length and False in any other case. # All triangles must have surface greater than 0 to be accepted def is_triangle(a, b, c): return True if a+b>c and a+c>b and c+b>a else False
def is_triangle(a, b, c): return True if a + b > c and a + c > b and (c + b > a) else False
number1 = input("Please enter a number and press enter: ") number2 = input("Please enter another nunber and press enter ") number1 = int(number1) number2 = int(number2) print("number1 + number2 =", number1+number2)
number1 = input('Please enter a number and press enter: ') number2 = input('Please enter another nunber and press enter ') number1 = int(number1) number2 = int(number2) print('number1 + number2 =', number1 + number2)
def solution(A, K): shift = K % len(A) if shift == 0: return A shifted_array = [] for i in range(-shift, len(A) - shift): shifted_array.append(A[i]) return shifted_array
def solution(A, K): shift = K % len(A) if shift == 0: return A shifted_array = [] for i in range(-shift, len(A) - shift): shifted_array.append(A[i]) return shifted_array
s = list(input()) a = "".join(s[:5]) b = "".join(s[6:13]) c = "".join(s[14:21]) print(a,b,c)
s = list(input()) a = ''.join(s[:5]) b = ''.join(s[6:13]) c = ''.join(s[14:21]) print(a, b, c)
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"Helpers": "Helpers.ipynb", "notify": "Helpers.ipynb", "keys": "Helpers.ipynb", "scanDb": "Helpers.ipynb", "toDf": "Helpers.ipynb", "fromSeries": "Helpers.ipynb", "fromDf": "Helpers.ipynb", "fromDict": "Helpers.ipynb", "toListDict": "Helpers.ipynb", "toSeries": "Helpers.ipynb", "setNoUpdate": "Helpers.ipynb", "setUpdate": "Helpers.ipynb", "DATABASE_TABLE_NAME": "database.ipynb", "INVENTORY_BUCKET_NAME": "database.ipynb", "INPUT_BUCKET_NAME": "database.ipynb", "REGION": "database.ipynb", "ACCESS_KEY_ID": "database.ipynb", "SECRET_ACCESS_KEY": "database.ipynb", "LINEKEY": "database.ipynb", "createIndex": "KeySchema.ipynb", "KeySchema": "KeySchema.ipynb", "DBHASHLOCATION": "database.ipynb", "DBCACHELOCATION": "database.ipynb", "ALLDATAKEY": "S3.ipynb", "DEFAULTKEYS": "S3.ipynb", "S3Cache": "S3.ipynb", "loadFromCache": "S3.ipynb", "saveRemoteCache": "S3.ipynb", "resetS3Cache": "S3.ipynb", "BRANCH": "database.ipynb", "VALUEUPDATESCHEMAURL": "Update.ipynb", "Updater": "Update.ipynb", "updateWithDict": "Update.ipynb", "ValueUpdate2": "Update.ipynb", "saveBatchToDynamodb": "Update.ipynb", "saveBatchToDynamodb2": "Update.ipynb", "valueUpdate2": "Update.ipynb", "INTCOLS": "database.ipynb", "ECOMMERCE_COL_LIST": "database.ipynb", "ProductDatabase": "database.ipynb", "cacheDb": "database.ipynb", "lambdaDumpToS3": "database.ipynb", "lambdaDumpOnlineS3": "database.ipynb", "Product": "database.ipynb", "ValueUpdate": "database.ipynb", "chunks": "database.ipynb", "lambdaUpdateProduct": "database.ipynb", "updateS3Input": "database.ipynb", "lambdaUpdateS3": "database.ipynb", "ProductsFromList": "query.ipynb", "lambdaProductsFromList": "database.ipynb", "lambdaSingleQuery": "database.ipynb", "lambdaAllQuery": "database.ipynb", "lambdaAllQueryFeather": "database.ipynb", "Querier": "query.ipynb", "allQuery": "query.ipynb", "productsFromList": "query.ipynb", "singleProductQuery": "query.ipynb"} modules = ["helpers.py", "schema.py", "s3.py", "update.py", "database.py", "query.py"] doc_url = "https://thanakijwanavit.github.io/villaProductDatabase/" git_url = "https://github.com/thanakijwanavit/villaProductDatabase/tree/master/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'Helpers': 'Helpers.ipynb', 'notify': 'Helpers.ipynb', 'keys': 'Helpers.ipynb', 'scanDb': 'Helpers.ipynb', 'toDf': 'Helpers.ipynb', 'fromSeries': 'Helpers.ipynb', 'fromDf': 'Helpers.ipynb', 'fromDict': 'Helpers.ipynb', 'toListDict': 'Helpers.ipynb', 'toSeries': 'Helpers.ipynb', 'setNoUpdate': 'Helpers.ipynb', 'setUpdate': 'Helpers.ipynb', 'DATABASE_TABLE_NAME': 'database.ipynb', 'INVENTORY_BUCKET_NAME': 'database.ipynb', 'INPUT_BUCKET_NAME': 'database.ipynb', 'REGION': 'database.ipynb', 'ACCESS_KEY_ID': 'database.ipynb', 'SECRET_ACCESS_KEY': 'database.ipynb', 'LINEKEY': 'database.ipynb', 'createIndex': 'KeySchema.ipynb', 'KeySchema': 'KeySchema.ipynb', 'DBHASHLOCATION': 'database.ipynb', 'DBCACHELOCATION': 'database.ipynb', 'ALLDATAKEY': 'S3.ipynb', 'DEFAULTKEYS': 'S3.ipynb', 'S3Cache': 'S3.ipynb', 'loadFromCache': 'S3.ipynb', 'saveRemoteCache': 'S3.ipynb', 'resetS3Cache': 'S3.ipynb', 'BRANCH': 'database.ipynb', 'VALUEUPDATESCHEMAURL': 'Update.ipynb', 'Updater': 'Update.ipynb', 'updateWithDict': 'Update.ipynb', 'ValueUpdate2': 'Update.ipynb', 'saveBatchToDynamodb': 'Update.ipynb', 'saveBatchToDynamodb2': 'Update.ipynb', 'valueUpdate2': 'Update.ipynb', 'INTCOLS': 'database.ipynb', 'ECOMMERCE_COL_LIST': 'database.ipynb', 'ProductDatabase': 'database.ipynb', 'cacheDb': 'database.ipynb', 'lambdaDumpToS3': 'database.ipynb', 'lambdaDumpOnlineS3': 'database.ipynb', 'Product': 'database.ipynb', 'ValueUpdate': 'database.ipynb', 'chunks': 'database.ipynb', 'lambdaUpdateProduct': 'database.ipynb', 'updateS3Input': 'database.ipynb', 'lambdaUpdateS3': 'database.ipynb', 'ProductsFromList': 'query.ipynb', 'lambdaProductsFromList': 'database.ipynb', 'lambdaSingleQuery': 'database.ipynb', 'lambdaAllQuery': 'database.ipynb', 'lambdaAllQueryFeather': 'database.ipynb', 'Querier': 'query.ipynb', 'allQuery': 'query.ipynb', 'productsFromList': 'query.ipynb', 'singleProductQuery': 'query.ipynb'} modules = ['helpers.py', 'schema.py', 's3.py', 'update.py', 'database.py', 'query.py'] doc_url = 'https://thanakijwanavit.github.io/villaProductDatabase/' git_url = 'https://github.com/thanakijwanavit/villaProductDatabase/tree/master/' def custom_doc_links(name): return None
def Contract_scalar_2x5(\ t0_6,t1_6,t2_6,t3_6,\ t0_5,t1_5,t2_5,t3_5,\ t0_4,t1_4,t2_4,t3_4,\ t0_3,t1_3,t2_3,t3_3,\ t0_2,t1_2,t2_2,t3_2,\ t0_1,t1_1,t2_1,t3_1,\ t0_0,t1_0,t2_0,t3_0,\ o1_5,o2_5,\ o1_4,o2_4,\ o1_3,o2_3,\ o1_2,o2_2,\ o1_1,o2_1\ ): ############################## # ./input/input_Lx2Ly5.dat ############################## # (o1_2*(t1_2*((t0_2*((t1_1*((t1_1.conj()*o1_1)*(t1_0*(t0_0*t0_1))))*(t2_1*((o2_1*t2_1.conj())*(t2_0*(t3_0*t3_1))))))*(t1_2.conj()*(t2_2.conj()*((o2_2*t2_2)*(t3_2*(t0_3*(t1_3.conj()*((t1_3*o1_3)*(t2_3*((t2_3.conj()*o2_3)*(t3_3*(t0_4*(t1_4*((t1_4.conj()*o1_4)*(t2_4*((t2_4.conj()*o2_4)*(t3_4*((t2_5*((o2_5*t2_5.conj())*(t2_6*(t3_6*t3_5))))*(t1_5.conj()*((o1_5*t1_5)*(t0_5*(t0_6*t1_6)))))))))))))))))))))))) # cpu_cost= 3.22004e+13 memory= 4.00042e+10 # final_bond_order () ############################## return np.tensordot( o1_2, np.tensordot( t1_2, np.tensordot( np.tensordot( t0_2, np.tensordot( np.tensordot( t1_1, np.tensordot( np.tensordot( t1_1.conj(), o1_1, ([4], [1]) ), np.tensordot( t1_0, np.tensordot( t0_0, t0_1, ([1], [0]) ), ([1], [0]) ), ([0, 3], [5, 2]) ), ([0, 3, 4], [6, 4, 2]) ), np.tensordot( t2_1, np.tensordot( np.tensordot( o2_1, t2_1.conj(), ([1], [4]) ), np.tensordot( t2_0, np.tensordot( t3_0, t3_1, ([0], [1]) ), ([0], [0]) ), ([3, 4], [5, 2]) ), ([2, 3, 4], [6, 4, 0]) ), ([1, 3, 4], [0, 2, 4]) ), ([0], [2]) ), np.tensordot( t1_2.conj(), np.tensordot( t2_2.conj(), np.tensordot( np.tensordot( o2_2, t2_2, ([0], [4]) ), np.tensordot( t3_2, np.tensordot( t0_3, np.tensordot( t1_3.conj(), np.tensordot( np.tensordot( t1_3, o1_3, ([4], [0]) ), np.tensordot( t2_3, np.tensordot( np.tensordot( t2_3.conj(), o2_3, ([4], [1]) ), np.tensordot( t3_3, np.tensordot( t0_4, np.tensordot( t1_4, np.tensordot( np.tensordot( t1_4.conj(), o1_4, ([4], [1]) ), np.tensordot( t2_4, np.tensordot( np.tensordot( t2_4.conj(), o2_4, ([4], [1]) ), np.tensordot( t3_4, np.tensordot( np.tensordot( t2_5, np.tensordot( np.tensordot( o2_5, t2_5.conj(), ([1], [4]) ), np.tensordot( t2_6, np.tensordot( t3_6, t3_5, ([1], [0]) ), ([1], [0]) ), ([2, 3], [2, 5]) ), ([1, 2, 4], [4, 6, 0]) ), np.tensordot( t1_5.conj(), np.tensordot( np.tensordot( o1_5, t1_5, ([0], [4]) ), np.tensordot( t0_5, np.tensordot( t0_6, t1_6, ([1], [0]) ), ([1], [0]) ), ([1, 2], [1, 4]) ), ([0, 1, 4], [4, 6, 0]) ), ([0, 2, 4], [2, 0, 5]) ), ([0], [2]) ), ([1, 2], [4, 2]) ), ([1, 2, 4], [5, 4, 2]) ), ([1, 2], [5, 2]) ), ([1, 2, 4], [7, 3, 2]) ), ([1, 2, 3], [7, 0, 2]) ), ([0], [5]) ), ([1, 2], [7, 2]) ), ([1, 2, 4], [8, 4, 2]) ), ([1, 2], [6, 0]) ), ([1, 2, 4], [8, 4, 2]) ), ([1, 2, 3], [7, 2, 0]) ), ([0], [5]) ), ([2, 3], [6, 1]) ), ([1, 2, 4], [8, 4, 0]) ), ([1, 2], [6, 0]) ), ([0, 2, 4, 5, 6, 7], [7, 0, 1, 5, 3, 6]) ), ([0, 1, 2, 3], [0, 4, 3, 1]) ), ([0, 1], [0, 1]) )
def contract_scalar_2x5(t0_6, t1_6, t2_6, t3_6, t0_5, t1_5, t2_5, t3_5, t0_4, t1_4, t2_4, t3_4, t0_3, t1_3, t2_3, t3_3, t0_2, t1_2, t2_2, t3_2, t0_1, t1_1, t2_1, t3_1, t0_0, t1_0, t2_0, t3_0, o1_5, o2_5, o1_4, o2_4, o1_3, o2_3, o1_2, o2_2, o1_1, o2_1): return np.tensordot(o1_2, np.tensordot(t1_2, np.tensordot(np.tensordot(t0_2, np.tensordot(np.tensordot(t1_1, np.tensordot(np.tensordot(t1_1.conj(), o1_1, ([4], [1])), np.tensordot(t1_0, np.tensordot(t0_0, t0_1, ([1], [0])), ([1], [0])), ([0, 3], [5, 2])), ([0, 3, 4], [6, 4, 2])), np.tensordot(t2_1, np.tensordot(np.tensordot(o2_1, t2_1.conj(), ([1], [4])), np.tensordot(t2_0, np.tensordot(t3_0, t3_1, ([0], [1])), ([0], [0])), ([3, 4], [5, 2])), ([2, 3, 4], [6, 4, 0])), ([1, 3, 4], [0, 2, 4])), ([0], [2])), np.tensordot(t1_2.conj(), np.tensordot(t2_2.conj(), np.tensordot(np.tensordot(o2_2, t2_2, ([0], [4])), np.tensordot(t3_2, np.tensordot(t0_3, np.tensordot(t1_3.conj(), np.tensordot(np.tensordot(t1_3, o1_3, ([4], [0])), np.tensordot(t2_3, np.tensordot(np.tensordot(t2_3.conj(), o2_3, ([4], [1])), np.tensordot(t3_3, np.tensordot(t0_4, np.tensordot(t1_4, np.tensordot(np.tensordot(t1_4.conj(), o1_4, ([4], [1])), np.tensordot(t2_4, np.tensordot(np.tensordot(t2_4.conj(), o2_4, ([4], [1])), np.tensordot(t3_4, np.tensordot(np.tensordot(t2_5, np.tensordot(np.tensordot(o2_5, t2_5.conj(), ([1], [4])), np.tensordot(t2_6, np.tensordot(t3_6, t3_5, ([1], [0])), ([1], [0])), ([2, 3], [2, 5])), ([1, 2, 4], [4, 6, 0])), np.tensordot(t1_5.conj(), np.tensordot(np.tensordot(o1_5, t1_5, ([0], [4])), np.tensordot(t0_5, np.tensordot(t0_6, t1_6, ([1], [0])), ([1], [0])), ([1, 2], [1, 4])), ([0, 1, 4], [4, 6, 0])), ([0, 2, 4], [2, 0, 5])), ([0], [2])), ([1, 2], [4, 2])), ([1, 2, 4], [5, 4, 2])), ([1, 2], [5, 2])), ([1, 2, 4], [7, 3, 2])), ([1, 2, 3], [7, 0, 2])), ([0], [5])), ([1, 2], [7, 2])), ([1, 2, 4], [8, 4, 2])), ([1, 2], [6, 0])), ([1, 2, 4], [8, 4, 2])), ([1, 2, 3], [7, 2, 0])), ([0], [5])), ([2, 3], [6, 1])), ([1, 2, 4], [8, 4, 0])), ([1, 2], [6, 0])), ([0, 2, 4, 5, 6, 7], [7, 0, 1, 5, 3, 6])), ([0, 1, 2, 3], [0, 4, 3, 1])), ([0, 1], [0, 1]))
""" Jupyter notebook config https://jupyter-notebook.readthedocs.io/en/stable/config.html """ def scrub_output_pre_save(model, **kwargs): """ Scrub notebook output before saving https://gist.github.com/binaryfunt/f31a7ecc8d698dd0edbec1489f2ab055 """ # Only run on notebooks if model["type"] != "notebook": return # Only run on nbformat v4 if model["content"]["nbformat"] != 4: return for cell in model["content"]["cells"]: if cell["cell_type"] != "code": continue cell["outputs"] = [] cell["execution_count"] = None if "collapsed" in cell["metadata"]: cell["metadata"].pop("collapsed", 0) c.FileContentsManager.pre_save_hook = scrub_output_pre_save
""" Jupyter notebook config https://jupyter-notebook.readthedocs.io/en/stable/config.html """ def scrub_output_pre_save(model, **kwargs): """ Scrub notebook output before saving https://gist.github.com/binaryfunt/f31a7ecc8d698dd0edbec1489f2ab055 """ if model['type'] != 'notebook': return if model['content']['nbformat'] != 4: return for cell in model['content']['cells']: if cell['cell_type'] != 'code': continue cell['outputs'] = [] cell['execution_count'] = None if 'collapsed' in cell['metadata']: cell['metadata'].pop('collapsed', 0) c.FileContentsManager.pre_save_hook = scrub_output_pre_save
class TreeNode(object): def __init__(self, value): self.value = value self.left = None self.right = None # store the number of left child for each tree Node self.num_of_left = 0 # store the max height difference self.max_diff = float('-inf') self.max_diff_node = None
class Treenode(object): def __init__(self, value): self.value = value self.left = None self.right = None self.num_of_left = 0 self.max_diff = float('-inf') self.max_diff_node = None
class Config(object): VERSION = "0.1.1" TEMPLATES_PATH = "config/" HEADERS = "headers.template" MAIL_FROM = "notify@example.com" MAIL_TO = "root@example.org" SUBJECT = "Mail from mailer.py\n\n" TEMPLATE = "default.message"
class Config(object): version = '0.1.1' templates_path = 'config/' headers = 'headers.template' mail_from = 'notify@example.com' mail_to = 'root@example.org' subject = 'Mail from mailer.py\n\n' template = 'default.message'
''' Write a program which takes an array of n integers, where A[i] denotes the maximum you can advance from index l, and returns whether it is possible to advance to the last index starting from the beginning of the array. ''' def can_reach_end(array): # Time: O(n) | Space: O(1) furthest_reached = 0 last_index = len(array) - 1 i = 0 while i <= furthest_reached and furthest_reached < last_index: furthest_reached = max(furthest_reached, array[i] + i) i += 1 return furthest_reached assert(can_reach_end([3, 3, 1, 0, 2, 0, 1]) == 6) assert(can_reach_end([3, 2, 0, 0, 2, 0, 1]) == 3) assert(can_reach_end([3, 2, -1, 0, 2, 0, 1]) == 3)
""" Write a program which takes an array of n integers, where A[i] denotes the maximum you can advance from index l, and returns whether it is possible to advance to the last index starting from the beginning of the array. """ def can_reach_end(array): furthest_reached = 0 last_index = len(array) - 1 i = 0 while i <= furthest_reached and furthest_reached < last_index: furthest_reached = max(furthest_reached, array[i] + i) i += 1 return furthest_reached assert can_reach_end([3, 3, 1, 0, 2, 0, 1]) == 6 assert can_reach_end([3, 2, 0, 0, 2, 0, 1]) == 3 assert can_reach_end([3, 2, -1, 0, 2, 0, 1]) == 3
def pubkeys(obj): keys = list() for key in (key for key in dir(obj) if not key.startswith('_')): keys.append(key) return keys
def pubkeys(obj): keys = list() for key in (key for key in dir(obj) if not key.startswith('_')): keys.append(key) return keys
num_queries = int(input()) def executeQuery(num_queries): stack = list() string = "" k = 0 for i in range(num_queries): q = input().split() if(q[0] == '4'): string = stack.pop() elif(q[0] == '1'): stack.append(string) string += q[1] elif(q[0] == '2'): str_len = len(string) stack.append(string) k = int(q[1]) if(str_len == k): string = "" else: string = string[0:str_len - k] else: print(string[int(q[1]) - 1]) executeQuery(num_queries)
num_queries = int(input()) def execute_query(num_queries): stack = list() string = '' k = 0 for i in range(num_queries): q = input().split() if q[0] == '4': string = stack.pop() elif q[0] == '1': stack.append(string) string += q[1] elif q[0] == '2': str_len = len(string) stack.append(string) k = int(q[1]) if str_len == k: string = '' else: string = string[0:str_len - k] else: print(string[int(q[1]) - 1]) execute_query(num_queries)
""" Return sum of iterable and start value -------------------------------------- Input: value optional: start value Return: sum of values """ numbers = [0, 1, 2, 3, 4, 5] print('numbers: {}\n sum: {}'.format(numbers, sum(numbers))) start_value = 10 print('numbers: {} + start value: {}\n sum: {}'.format(numbers, start_value, sum(numbers, start_value))) numbers = [0, 1, 2, 3, 4, 5, -10] print('numbers: {}\n sum: {}'.format(numbers, sum(numbers)))
""" Return sum of iterable and start value -------------------------------------- Input: value optional: start value Return: sum of values """ numbers = [0, 1, 2, 3, 4, 5] print('numbers: {}\n sum: {}'.format(numbers, sum(numbers))) start_value = 10 print('numbers: {} + start value: {}\n sum: {}'.format(numbers, start_value, sum(numbers, start_value))) numbers = [0, 1, 2, 3, 4, 5, -10] print('numbers: {}\n sum: {}'.format(numbers, sum(numbers)))
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" with open("p022_names.txt") as f: names = f.read().split(",") names = [x.replace("\"", "") for x in names] names.sort() total = 0 for i, name in enumerate(names): score = 0 for letter in name: score += ALPHABET.index(letter) + 1 total += (i + 1) * score print(total)
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' with open('p022_names.txt') as f: names = f.read().split(',') names = [x.replace('"', '') for x in names] names.sort() total = 0 for (i, name) in enumerate(names): score = 0 for letter in name: score += ALPHABET.index(letter) + 1 total += (i + 1) * score print(total)
# data = [1,2,3,4,5,6,7] data = [2,1,4,6,7,5,3,9,10,8] print(data) def heap_min(data): length = len(data) for i in range(length-1,-1, -1): if data[i] < data[i//2]: data[i],data[i//2] = data[i//2],data[i] return data def sort(data): ll = [] length = len(data) for i in range(0,length): data = heap_min(data[:]) ll.append(data[0]) del data[0] print(data) return ll data = sort(data) print(data)
data = [2, 1, 4, 6, 7, 5, 3, 9, 10, 8] print(data) def heap_min(data): length = len(data) for i in range(length - 1, -1, -1): if data[i] < data[i // 2]: (data[i], data[i // 2]) = (data[i // 2], data[i]) return data def sort(data): ll = [] length = len(data) for i in range(0, length): data = heap_min(data[:]) ll.append(data[0]) del data[0] print(data) return ll data = sort(data) print(data)
""" Node is defined as class node: def __init__(self, data): self.data = data self.left = None self.right = None """ def check_binary_search_tree_(root, minBound = 0, maxBound = 10000): if root.left is not None: if root.left.data >= root.data: return False if not minBound <= root.left.data <= maxBound: return False if not check_binary_search_tree_(root.left, minBound, root.data - 1): return False if root.right is not None: if root.right.data <= root.data: return False if not minBound <= root.right.data <= maxBound: return False if not check_binary_search_tree_(root.right, root.data + 1, maxBound): return False return True
""" Node is defined as class node: def __init__(self, data): self.data = data self.left = None self.right = None """ def check_binary_search_tree_(root, minBound=0, maxBound=10000): if root.left is not None: if root.left.data >= root.data: return False if not minBound <= root.left.data <= maxBound: return False if not check_binary_search_tree_(root.left, minBound, root.data - 1): return False if root.right is not None: if root.right.data <= root.data: return False if not minBound <= root.right.data <= maxBound: return False if not check_binary_search_tree_(root.right, root.data + 1, maxBound): return False return True
#Intersection: Given two (singly) linked lists, determine if the two lists intersect. #Return the intersecting node. Note that the intersection is defined based on reference, #not value. That is, if the kth node of the first linked list is the exact same node (by #reference) as the jth node of the second linked list, then they are intersecting #in Python i can compare objects its the same? A: yes #Since i got classes i can pass the var by "reference" cause it will be the object #The only way its possible is if the second linked list is at the end of the first one # i.e 1->2->3->4->5->6 && 4->5->6 i cannot have and intersecting linked list in the middle #of the other one cause then it wont point to the same next object and so on #asuming that i could just traverse it until i find the first node class LinkedList: def __init__(self,value): self.next=None self.value=value def add(self,value): head = self while head.next != None: head = head.next head.next= LinkedList(value) def push(self,value): new_head=LinkedList(value) new_head.next=self return new_head def print(self): head = self while head.next != None: print(head.value, end = '') head = head.next print(head.value) def intersection(l1,l2): #O(n) while l1: if l1 == l2: # worst caseO(n) return l1 l1=l1.next return None l = LinkedList(2) l.add(3) l.add(2) l.add(1) l.add(2) l.add(5) l.add(3) l.add(7) l.print() # 23212537 print(intersection(l,l.next.next.next).value) #1 l2 = LinkedList(2) l2.add(3) l2.add(2) l2.add(1) l2.add(2) l2.add(5) l2.add(3) l2.add(7) print(intersection(l,l2))#None # Since i thought it was really easy i read some hints so i have to check if either l1 #intersects l2 or l2 intersects l1 def intersection2(l1,l2): #O(n+m) l1cp=l1 while l1: if l1 == l2: # worst case O(n) return l1 l1=l1.next while l2: if l1cp ==l2: # worst case O(m) return l2 l2=l2.next return None print(intersection2(l.next.next.next,l).value)#1 print(intersection2(l2,l))#None print(intersection(l.next.next.next,l)) #None
class Linkedlist: def __init__(self, value): self.next = None self.value = value def add(self, value): head = self while head.next != None: head = head.next head.next = linked_list(value) def push(self, value): new_head = linked_list(value) new_head.next = self return new_head def print(self): head = self while head.next != None: print(head.value, end='') head = head.next print(head.value) def intersection(l1, l2): while l1: if l1 == l2: return l1 l1 = l1.next return None l = linked_list(2) l.add(3) l.add(2) l.add(1) l.add(2) l.add(5) l.add(3) l.add(7) l.print() print(intersection(l, l.next.next.next).value) l2 = linked_list(2) l2.add(3) l2.add(2) l2.add(1) l2.add(2) l2.add(5) l2.add(3) l2.add(7) print(intersection(l, l2)) def intersection2(l1, l2): l1cp = l1 while l1: if l1 == l2: return l1 l1 = l1.next while l2: if l1cp == l2: return l2 l2 = l2.next return None print(intersection2(l.next.next.next, l).value) print(intersection2(l2, l)) print(intersection(l.next.next.next, l))
def factorial(a): if a == 1: return 1 else: return (a * factorial(a-1)) num = 7 print("The factorial of", num, "is", factorial(num))
def factorial(a): if a == 1: return 1 else: return a * factorial(a - 1) num = 7 print('The factorial of', num, 'is', factorial(num))
""" from predict import get_most_likely_author from iris import iris_predict_one, score # STUFF FROM CLASS. DOESN'T HAVE base.html @app.route('/add_author') def add_author(): twitter_handle = request.args['twitter_handle'] new_user = upsert_user(twitter_handle, nlp) return '{}\'s tweets added to the database: {}'.format(new_user.name , ', '.join([t.text for t in new_user.tweets])) @app.route('/predict_author') def predict_author(): tweet_to_classify = request.args['tweet_to_classify'] users = [user.name for user in User.query.all()] most_likely_author = get_most_likely_author(users, tweet_to_classify, nlp) return most_likely_author @app.route('/latest_tweet') def latest_tweet(): twitter_handle = request.args['twitter_handle'] twitter_user = retrieve_user(twitter_handle) return f'@{twitter_user.name}\'s latest tweet in the DB is: {twitter_user.tweets[-1].text}' @app.route('/iris') def iris(): prediction = iris_predict_one(200) return str(prediction) @app.route('/iris_score') def iris_score(): return str(score()) # STUFF FROM CLASS JUNE 10 -- NOT WORKING # ALSO REMOVED twitter FROM IMPORT STATEMENTS # For example, changed to 'from .twitter.data.model' def create_app(): app = Flask(__name__) # add twitter api app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///twitter_db.sqlite3' DB.init_app(app) # pdb.set_trace() nlp_path = os.path.join('/'.join(os.path.abspath(__file__).split('/')[:-1]), 'my_model') nlp = spacy.load(nlp_path) @app.route('/') def root(): return render_template('base.html', title='Predictor', users=User.query.all()) @app.route('/user', methods=['POST']) @app.route('/user/<name>', methods=['GET']) def user(name=None, message=''): name = name or request.values["user_name"] try: if request.method == "POST": upsert_user(name, nlp) message = f"User {name} successfully added!" tweets = User.query.filter(User.name == name).one().tweets except Exception as e: message = f"Error adding {name}: {e}" tweets = [] return render_template("user.html", title=name, tweets=tweets, message=message) @app.route('/compare', methods=["POST"]) def compare(): # getting users and hypothetical tweet from client user0, user1 = sorted( [request.values['user0'], request.values['user1']]) tweet_to_classify = request.values["tweet_text"] # stops clients from comparing same user if user0 == user1: message = "Cannot compare users to themselves!" else: # Function returns a tuple of (prediction, probability) prediction = compare_two_tweets(user0, user1, tweet_to_classify, nlp) message = 'The tweet "{}" is more likely to be from @{} than @{} at {}% probability.'.format( tweet_to_classify, # Changed 2 to 1 and 1 to 0. NOT TESTED user1 if prediction[0] == 0 else user0, user0 if prediction[0] == 1 else user1, prediction[1] ) return render_template('prediction.html', title='Prediction', message=message) return app # if __name__ == '__main__': # app.run() In __init__.py: from .twitter_app import create_app APP = create_app() """
""" from predict import get_most_likely_author from iris import iris_predict_one, score # STUFF FROM CLASS. DOESN'T HAVE base.html @app.route('/add_author') def add_author(): twitter_handle = request.args['twitter_handle'] new_user = upsert_user(twitter_handle, nlp) return '{}'s tweets added to the database: {}'.format(new_user.name , ', '.join([t.text for t in new_user.tweets])) @app.route('/predict_author') def predict_author(): tweet_to_classify = request.args['tweet_to_classify'] users = [user.name for user in User.query.all()] most_likely_author = get_most_likely_author(users, tweet_to_classify, nlp) return most_likely_author @app.route('/latest_tweet') def latest_tweet(): twitter_handle = request.args['twitter_handle'] twitter_user = retrieve_user(twitter_handle) return f'@{twitter_user.name}'s latest tweet in the DB is: {twitter_user.tweets[-1].text}' @app.route('/iris') def iris(): prediction = iris_predict_one(200) return str(prediction) @app.route('/iris_score') def iris_score(): return str(score()) # STUFF FROM CLASS JUNE 10 -- NOT WORKING # ALSO REMOVED twitter FROM IMPORT STATEMENTS # For example, changed to 'from .twitter.data.model' def create_app(): app = Flask(__name__) # add twitter api app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///twitter_db.sqlite3' DB.init_app(app) # pdb.set_trace() nlp_path = os.path.join('/'.join(os.path.abspath(__file__).split('/')[:-1]), 'my_model') nlp = spacy.load(nlp_path) @app.route('/') def root(): return render_template('base.html', title='Predictor', users=User.query.all()) @app.route('/user', methods=['POST']) @app.route('/user/<name>', methods=['GET']) def user(name=None, message=''): name = name or request.values["user_name"] try: if request.method == "POST": upsert_user(name, nlp) message = f"User {name} successfully added!" tweets = User.query.filter(User.name == name).one().tweets except Exception as e: message = f"Error adding {name}: {e}" tweets = [] return render_template("user.html", title=name, tweets=tweets, message=message) @app.route('/compare', methods=["POST"]) def compare(): # getting users and hypothetical tweet from client user0, user1 = sorted( [request.values['user0'], request.values['user1']]) tweet_to_classify = request.values["tweet_text"] # stops clients from comparing same user if user0 == user1: message = "Cannot compare users to themselves!" else: # Function returns a tuple of (prediction, probability) prediction = compare_two_tweets(user0, user1, tweet_to_classify, nlp) message = 'The tweet "{}" is more likely to be from @{} than @{} at {}% probability.'.format( tweet_to_classify, # Changed 2 to 1 and 1 to 0. NOT TESTED user1 if prediction[0] == 0 else user0, user0 if prediction[0] == 1 else user1, prediction[1] ) return render_template('prediction.html', title='Prediction', message=message) return app # if __name__ == '__main__': # app.run() In __init__.py: from .twitter_app import create_app APP = create_app() """
batch = [[1, 5, 6, 2], # shape (8,4) [3, 2, 1, 3], [5, 2, 1, 2], [6, 4, 8, 4], [2, 8, 5, 3], [1, 1, 9, 4], [6, 6, 0, 4], [8, 7, 6, 4]] # https://nnfs.io/lqw # https://nnfs.io/vyu # https://nnfs.io/jei # https://nnfs.io/bkw
batch = [[1, 5, 6, 2], [3, 2, 1, 3], [5, 2, 1, 2], [6, 4, 8, 4], [2, 8, 5, 3], [1, 1, 9, 4], [6, 6, 0, 4], [8, 7, 6, 4]]
class Messenger(object): def __init__(self, logger, messageDisplay): self.logger = logger self.messageDisplay = messageDisplay #Test this... def sendMessage(self, message): self.logger.info(message) def sendUpdate(self, message): # this should update the button text -- probably does not belong on this object self.logger.info(message) def showSaveAndExit(self): return self.messageDisplay.askquestion( 'Save And Quit', 'Would you like to save your changes?') def showCardIsNotPaired(self): self.messageDisplay.showinfo( 'Card Unassigned', 'Card is not currently assigned to a video') def showCannotPairToInactiveVideos(self): self.messageDisplay.showinfo('Video Is Not Active', 'This video\'s file wasn\'t found on the last scan. Please rescan, and pair again.') def showCardScannedIsAKiller(self): self.messageDisplay.showinfo( 'Kill Card', 'This card is currently assigned to kill the application.') def showDefaultDeviceWarning(self): self.messageDisplay.showwarning( 'No USB Set', 'Please select a USB as a source device and then perform a Scan and Update') self.logger.warning('No USB device is set!') def displayScanError(self, e): self.messageDisplay.showerror('Error Occurred', 'Error: ' + str(e)) self.logger.error('Scan Failed: ' + str(e)) def showAbortScanMessage(self): self.messageDisplay.showwarning( 'No Files Found', 'A scan failed to find any files.') self.logger.warning('Empty Scan occurred when attempting a merge') def showScanErrorMessage(self, e): self.messageDisplay.showerror('Scan Failed', 'Scan error: ' + str(e)) self.logger.error(str(e)) # def showCurrentDeviceNotFoundWarning(self): # self.messageDisplay.showwarning( # 'Missing USB Source', 'WARNING: The current USB repository was not found among the available devices.') # self.logger.warning( # 'Current USB repository was not located in device scan!') # def terminateWithCurrentDeviceNotFoundMsg(self): # self.messageDisplay.showerror( # 'No Devices Detected', 'No devices were detected including the current USB repository.\nPlease inspect USB device, or contact help.') # self.logger.critical('Scanner detected no devices. Closing...') # SUGGEST - Removal # def terminateWithNoDeviceFailureMessage(self): # self.messageDisplay.showerror( # 'Storage Failure', 'No USB devices could be found, this editor will now close.') # self.logger.critical('Failed to find any devices with any media. Closing...') # SUGGEST - Removal # def showImproperStorageWarning(self): # self.messageDisplay.showerror( # 'Improper Storage', 'Media files should not be stored in /media/pi.\nPlease move files to subfolder, or a USB device.') # self.logger.error( # 'User error: Files were stored on pi media root. Requested User Action...')
class Messenger(object): def __init__(self, logger, messageDisplay): self.logger = logger self.messageDisplay = messageDisplay def send_message(self, message): self.logger.info(message) def send_update(self, message): self.logger.info(message) def show_save_and_exit(self): return self.messageDisplay.askquestion('Save And Quit', 'Would you like to save your changes?') def show_card_is_not_paired(self): self.messageDisplay.showinfo('Card Unassigned', 'Card is not currently assigned to a video') def show_cannot_pair_to_inactive_videos(self): self.messageDisplay.showinfo('Video Is Not Active', "This video's file wasn't found on the last scan. Please rescan, and pair again.") def show_card_scanned_is_a_killer(self): self.messageDisplay.showinfo('Kill Card', 'This card is currently assigned to kill the application.') def show_default_device_warning(self): self.messageDisplay.showwarning('No USB Set', 'Please select a USB as a source device and then perform a Scan and Update') self.logger.warning('No USB device is set!') def display_scan_error(self, e): self.messageDisplay.showerror('Error Occurred', 'Error: ' + str(e)) self.logger.error('Scan Failed: ' + str(e)) def show_abort_scan_message(self): self.messageDisplay.showwarning('No Files Found', 'A scan failed to find any files.') self.logger.warning('Empty Scan occurred when attempting a merge') def show_scan_error_message(self, e): self.messageDisplay.showerror('Scan Failed', 'Scan error: ' + str(e)) self.logger.error(str(e))
def welcome(): print("welcome to pyMassSpecTools") def cli(): welcome()
def welcome(): print('welcome to pyMassSpecTools') def cli(): welcome()
class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[96m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' print(bcolors.OKBLUE + bcolors.BOLD + "Hello I am you calculator" + bcolors.ENDC) button_first = input(bcolors.OKBLUE + bcolors.BOLD + "Type First Number: " + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + "You chose " + button_first + bcolors.ENDC) button_second = input(bcolors.OKBLUE + bcolors.BOLD + "Type Second Number: " + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + "You chose " + button_second + bcolors.ENDC) button_third = input(bcolors.OKBLUE + bcolors.BOLD + "Type + - * or /: " + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + "You chose " + button_third + bcolors.ENDC) if button_third == "+": number1 = int(button_first) + int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + "You got: " + str(number1) + bcolors.ENDC) elif button_third == "-": number2 = int(button_first) - int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + "You got: " + str(number2) + bcolors.ENDC) elif button_third == "*": number3 = int(button_first) * int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + "You got: " + str(number3) + bcolors.ENDC) elif button_third == "/": number4 = int(button_first) / int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + "You got: " + str(number4) + bcolors.ENDC)
class Bcolors: header = '\x1b[95m' okblue = '\x1b[94m' okcyan = '\x1b[96m' okgreen = '\x1b[92m' warning = '\x1b[93m' fail = '\x1b[91m' endc = '\x1b[0m' bold = '\x1b[1m' underline = '\x1b[4m' print(bcolors.OKBLUE + bcolors.BOLD + 'Hello I am you calculator' + bcolors.ENDC) button_first = input(bcolors.OKBLUE + bcolors.BOLD + 'Type First Number: ' + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + 'You chose ' + button_first + bcolors.ENDC) button_second = input(bcolors.OKBLUE + bcolors.BOLD + 'Type Second Number: ' + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + 'You chose ' + button_second + bcolors.ENDC) button_third = input(bcolors.OKBLUE + bcolors.BOLD + 'Type + - * or /: ' + bcolors.ENDC) print(bcolors.OKBLUE + bcolors.BOLD + 'You chose ' + button_third + bcolors.ENDC) if button_third == '+': number1 = int(button_first) + int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + 'You got: ' + str(number1) + bcolors.ENDC) elif button_third == '-': number2 = int(button_first) - int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + 'You got: ' + str(number2) + bcolors.ENDC) elif button_third == '*': number3 = int(button_first) * int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + 'You got: ' + str(number3) + bcolors.ENDC) elif button_third == '/': number4 = int(button_first) / int(button_second) print(bcolors.OKBLUE + bcolors.BOLD + 'You got: ' + str(number4) + bcolors.ENDC)
''' Created on 2014-11-30 @author: ouyangsiqi ''' class Card: ''' This class is the parking card ''' __cardId = 0 __levelId = 0 __spaceId = 0 def __init__(self, cardId, levelId, spaceId): ''' Constructor ''' self.__cardId = cardId self.__levelId = levelId self.__spaceId = spaceId def getCardId(self): ''' The method to get the card id ''' return self.__cardId def getLevelId(self): ''' The method to get the level id ''' return self.__levelId def getSpaceId(self): ''' The method to get the space id ''' return self.__spaceId
""" Created on 2014-11-30 @author: ouyangsiqi """ class Card: """ This class is the parking card """ __card_id = 0 __level_id = 0 __space_id = 0 def __init__(self, cardId, levelId, spaceId): """ Constructor """ self.__cardId = cardId self.__levelId = levelId self.__spaceId = spaceId def get_card_id(self): """ The method to get the card id """ return self.__cardId def get_level_id(self): """ The method to get the level id """ return self.__levelId def get_space_id(self): """ The method to get the space id """ return self.__spaceId
ENTRY_POINT = 'right_angle_triangle' #[PROMPT] def right_angle_triangle(a, b, c): ''' Given the lengths of the three sides of a triangle. Return True if the three sides form a right-angled triangle, False otherwise. A right-angled triangle is a triangle in which one angle is right angle or 90 degree. Example: right_angle_triangle(3, 4, 5) == True right_angle_triangle(1, 2, 3) == False ''' #[SOLUTION] return a*a == b*b + c*c or b*b == a*a + c*c or c*c == a*a + b*b #[CHECK] def check(candidate): # Check some simple cases assert candidate(3, 4, 5) == True, "This prints if this assert fails 1 (good for debugging!)" assert candidate(1, 2, 3) == False assert candidate(10, 6, 8) == True assert candidate(2, 2, 2) == False assert candidate(7, 24, 25) == True assert candidate(10, 5, 7) == False assert candidate(5, 12, 13) == True assert candidate(15, 8, 17) == True assert candidate(48, 55, 73) == True # Check some edge cases that are easy to work out by hand. assert candidate(1, 1, 1) == False, "This prints if this assert fails 2 (also good for debugging!)" assert candidate(2, 2, 10) == False
entry_point = 'right_angle_triangle' def right_angle_triangle(a, b, c): """ Given the lengths of the three sides of a triangle. Return True if the three sides form a right-angled triangle, False otherwise. A right-angled triangle is a triangle in which one angle is right angle or 90 degree. Example: right_angle_triangle(3, 4, 5) == True right_angle_triangle(1, 2, 3) == False """ return a * a == b * b + c * c or b * b == a * a + c * c or c * c == a * a + b * b def check(candidate): assert candidate(3, 4, 5) == True, 'This prints if this assert fails 1 (good for debugging!)' assert candidate(1, 2, 3) == False assert candidate(10, 6, 8) == True assert candidate(2, 2, 2) == False assert candidate(7, 24, 25) == True assert candidate(10, 5, 7) == False assert candidate(5, 12, 13) == True assert candidate(15, 8, 17) == True assert candidate(48, 55, 73) == True assert candidate(1, 1, 1) == False, 'This prints if this assert fails 2 (also good for debugging!)' assert candidate(2, 2, 10) == False
#!/usr/bin/env python # To run the script put 'python ./script.py' in terminal lines = [line.rstrip('\n') for line in open('sv_en.txt')] svArray = [] enArray = [] for s in lines: first,second = s.split(' = ') svArray.append( first ); enArray.append( second ); thefile = open('en.txt', 'w') for item in enArray: print>>thefile, item+" = " thefile.close() thefile = open('sv.txt', 'w') for item in svArray: print>>thefile, item thefile.close() thefile = open('sv_en_backup', 'w') for item in lines: print>>thefile, item thefile.close()
lines = [line.rstrip('\n') for line in open('sv_en.txt')] sv_array = [] en_array = [] for s in lines: (first, second) = s.split(' = ') svArray.append(first) enArray.append(second) thefile = open('en.txt', 'w') for item in enArray: (print >> thefile, item + ' = ') thefile.close() thefile = open('sv.txt', 'w') for item in svArray: (print >> thefile, item) thefile.close() thefile = open('sv_en_backup', 'w') for item in lines: (print >> thefile, item) thefile.close()
async def gotAddet(bot, guild): sID = await bot.db.fetchval('SELECT sid FROM config.guild WHERE sid = $1', guild.id) if sID is None: query = "WITH exec0 AS (INSERT INTO config.guild (sid, sname) VALUES ($1, $2)) INSERT INTO config.modules (sid) VALUES ($1)" await bot.db.execute(query, guild.id, guild.name) else: await bot.db.execute("UPDATE config.guild SET sname = $1 WHERE sid = $2", guild.name, guild.id)
async def gotAddet(bot, guild): s_id = await bot.db.fetchval('SELECT sid FROM config.guild WHERE sid = $1', guild.id) if sID is None: query = 'WITH exec0 AS (INSERT INTO config.guild (sid, sname) VALUES ($1, $2)) INSERT INTO config.modules (sid) VALUES ($1)' await bot.db.execute(query, guild.id, guild.name) else: await bot.db.execute('UPDATE config.guild SET sname = $1 WHERE sid = $2', guild.name, guild.id)
class RobotState: """ Interface a robot state must implement to be used with :py:class:`roboball2d.physics.rendering.pyglet_renderer.PygletRenderer` See : :py:class:`roboball2d.robot.default_robot_state.DefaultRobotState """ def __init__(self, robot_config, generalized_coordinates = None, generalized_velocities = None): raise NotImplementedError("__init__ not implemented.") def render(self): raise NotImplementedError("render not implemented.")
class Robotstate: """ Interface a robot state must implement to be used with :py:class:`roboball2d.physics.rendering.pyglet_renderer.PygletRenderer` See : :py:class:`roboball2d.robot.default_robot_state.DefaultRobotState """ def __init__(self, robot_config, generalized_coordinates=None, generalized_velocities=None): raise not_implemented_error('__init__ not implemented.') def render(self): raise not_implemented_error('render not implemented.')
# -*- coding: utf-8 -*- def main(): s = input() f = int(s[:2]) l = int(s[2:]) if 1 <= f <= 12 and 1 <= l <= 12: print('AMBIGUOUS') elif 1 <= l <= 12: print('YYMM') elif 1 <= f <= 12: print('MMYY') else: print('NA') if __name__ == '__main__': main()
def main(): s = input() f = int(s[:2]) l = int(s[2:]) if 1 <= f <= 12 and 1 <= l <= 12: print('AMBIGUOUS') elif 1 <= l <= 12: print('YYMM') elif 1 <= f <= 12: print('MMYY') else: print('NA') if __name__ == '__main__': main()
#!/usr/bin/env python # -*- coding: utf-8 -*- atoms = { 'C': 1, 'H': 4, 'O': 1, } bonds = { 'C-O': 1, 'C-H': 3, 'O-H': 1, } linear = False externalSymmetry = 1 spinMultiplicity = 2 opticalIsomers = 1 #confirmed energy = { 'M08SO': QchemLog('ch3oh.out'), } geometry = QchemLog('ch3oh.out') frequencies = QchemLog('ch3oh.out')
atoms = {'C': 1, 'H': 4, 'O': 1} bonds = {'C-O': 1, 'C-H': 3, 'O-H': 1} linear = False external_symmetry = 1 spin_multiplicity = 2 optical_isomers = 1 energy = {'M08SO': qchem_log('ch3oh.out')} geometry = qchem_log('ch3oh.out') frequencies = qchem_log('ch3oh.out')
A = 'A' B = 'B' C = 'C' D = 'D' state = {} action = None model = {A: None, B: None, C: None, D: None} # Initially ignorant RULE_ACTION = { 1: 'Suck', 2: 'Right', 3: 'NoOp' } rules = { (A, 'Dirty'):1, (B, 'Dirty'):1, (C, 'Dirty'):1, (D, 'Dirty'):1, (A, 'Clean'):2, (B, 'Clean'):2, (C, 'Clean'):2, (D, 'Clean'):2, (A, B, C, D, 'Clean'):3 } #Ex. rule (if location == A && Dirty then rule 1) Enviroment = { A: 'Dirty', B: 'Dirty', C: 'Dirty', D: 'Dirty', 'Current': A } def INTERPRET_INPUT(input): # No interpretation return input def RULE_MATCH(state,rules): # Match rule for a given state rule = rules.get(tuple(state)) return rule def UPDATE_STATE(state, action, percept): (location, status) = percept state = percept if model[A] == model[B] == model[C] == model[D] == 'Clean': state = (A, B, C, D, 'Clean') # Model consulted only for A and B clean model[location] = status # Update the model state return state def REFLEX_AGENT_WITH_STATE(percept): global state, action state = UPDATE_STATE(state, action, percept) rule = RULE_MATCH(state, rules) action = RULE_ACTION[rule] return action def Sensors(): # Sense Enviroment location = Enviroment['Current'] return (location, Enviroment[location]) def Actuators(action): # Modify Enviroment location = Enviroment['Current'] if action == 'Suck': Enviroment[location] = 'Clean' elif action == 'Right' and location == A: Enviroment['Current'] = B elif action == 'Right' and location == B: Enviroment['Current'] = C elif action == 'Right' and location == C: Enviroment['Current'] = D elif action == 'Right' and location == D: Enviroment['Current'] = A def run(n): # run the agent through n steps print(' Current New') print('Location Status Action Location Status') for i in range(1,n): (location, status) = Sensors() # Sense Enviroment before action print("{:12s}{:8s}".format(location, status), end='') action = REFLEX_AGENT_WITH_STATE(Sensors()) Actuators(action) (location, status) = Sensors() # Sense Enviroment after action print("{:8s}{:12s}{:4s}".format(action, location, status)) run(20)
a = 'A' b = 'B' c = 'C' d = 'D' state = {} action = None model = {A: None, B: None, C: None, D: None} rule_action = {1: 'Suck', 2: 'Right', 3: 'NoOp'} rules = {(A, 'Dirty'): 1, (B, 'Dirty'): 1, (C, 'Dirty'): 1, (D, 'Dirty'): 1, (A, 'Clean'): 2, (B, 'Clean'): 2, (C, 'Clean'): 2, (D, 'Clean'): 2, (A, B, C, D, 'Clean'): 3} enviroment = {A: 'Dirty', B: 'Dirty', C: 'Dirty', D: 'Dirty', 'Current': A} def interpret_input(input): return input def rule_match(state, rules): rule = rules.get(tuple(state)) return rule def update_state(state, action, percept): (location, status) = percept state = percept if model[A] == model[B] == model[C] == model[D] == 'Clean': state = (A, B, C, D, 'Clean') model[location] = status return state def reflex_agent_with_state(percept): global state, action state = update_state(state, action, percept) rule = rule_match(state, rules) action = RULE_ACTION[rule] return action def sensors(): location = Enviroment['Current'] return (location, Enviroment[location]) def actuators(action): location = Enviroment['Current'] if action == 'Suck': Enviroment[location] = 'Clean' elif action == 'Right' and location == A: Enviroment['Current'] = B elif action == 'Right' and location == B: Enviroment['Current'] = C elif action == 'Right' and location == C: Enviroment['Current'] = D elif action == 'Right' and location == D: Enviroment['Current'] = A def run(n): print(' Current New') print('Location Status Action Location Status') for i in range(1, n): (location, status) = sensors() print('{:12s}{:8s}'.format(location, status), end='') action = reflex_agent_with_state(sensors()) actuators(action) (location, status) = sensors() print('{:8s}{:12s}{:4s}'.format(action, location, status)) run(20)
class Config(object): DEBUG = True TESTING = True # MySQL config MYSQL_DATABASE_HOST = 'localhost' MYSQL_DATABASE_PORT = 3306 MYSQL_DATABASE_USER = 'knoydart' MYSQL_DATABASE_PASSWORD = '7xGFGzF8BbzsJFCd' MYSQL_DATABASE_DB = 'knoydart' MYSQL_DATABASE_CHARSET = 'utf8' DATATAKER_HOST = '185.34.63.131' DATATAKER_PORT = 7700 DATATAKER_PASS = 'q5DX5zZT2A'
class Config(object): debug = True testing = True mysql_database_host = 'localhost' mysql_database_port = 3306 mysql_database_user = 'knoydart' mysql_database_password = '7xGFGzF8BbzsJFCd' mysql_database_db = 'knoydart' mysql_database_charset = 'utf8' datataker_host = '185.34.63.131' datataker_port = 7700 datataker_pass = 'q5DX5zZT2A'
def part1(): values = [[int(i) if i.isnumeric() else i for i in i.split(" ")] for i in open("input.txt","r").read().split("\n")] depth = 0 horizontal = 0 for i in values: if i[0] == "up": depth -= i[1] elif i[0] == "down": depth += i[1] elif i[0] == "forward": horizontal += i[1] return depth*horizontal def part2(): values = [[int(i) if i.isnumeric() else i for i in i.split(" ")] for i in open("input.txt","r").read().split("\n")] aim = 0 depth = 0 horizontal = 0 for i in values: if i[0] == "up": aim -= i[1] elif i[0] == "down": aim += i[1] elif i[0] == "forward": horizontal += i[1] depth += aim * i[1] return depth*horizontal return total print(f"answer to part1: {part1()}") print(f"answer to part2: {part2()}")
def part1(): values = [[int(i) if i.isnumeric() else i for i in i.split(' ')] for i in open('input.txt', 'r').read().split('\n')] depth = 0 horizontal = 0 for i in values: if i[0] == 'up': depth -= i[1] elif i[0] == 'down': depth += i[1] elif i[0] == 'forward': horizontal += i[1] return depth * horizontal def part2(): values = [[int(i) if i.isnumeric() else i for i in i.split(' ')] for i in open('input.txt', 'r').read().split('\n')] aim = 0 depth = 0 horizontal = 0 for i in values: if i[0] == 'up': aim -= i[1] elif i[0] == 'down': aim += i[1] elif i[0] == 'forward': horizontal += i[1] depth += aim * i[1] return depth * horizontal return total print(f'answer to part1: {part1()}') print(f'answer to part2: {part2()}')
class Resources: class LoginPage: USERNAME_FIELD_PLACEHOLDER = "Username" PASSWORD_FIELD_PLACEHOLDER = "Password" LOGIN_BUTTON_TEXT = "Login" NON_EXISTING_USER_ERROR_TEXT = "Epic sadface: Username and password do not match any user in this service" MISSING_USERNAME_ERROR_TEXT = "Epic sadface: Username is required" MISSING_PASSWORD_ERROR_TEXT = "Epic sadface: Password is required" LOCKED_OUT_USER_ERROR_TEXT = "Epic sadface: Sorry, this user has been locked out."
class Resources: class Loginpage: username_field_placeholder = 'Username' password_field_placeholder = 'Password' login_button_text = 'Login' non_existing_user_error_text = 'Epic sadface: Username and password do not match any user in this service' missing_username_error_text = 'Epic sadface: Username is required' missing_password_error_text = 'Epic sadface: Password is required' locked_out_user_error_text = 'Epic sadface: Sorry, this user has been locked out.'
def fun(liczby): n = len(str(liczby)) dziel=1 tak = 10 suma = 0 cos = liczby for x in range(0,n): liczba=liczby%tak liczby-=liczba tak*=10 liczba/=dziel suma+=liczba dziel*=10 return int(suma) print(fun(545435433))
def fun(liczby): n = len(str(liczby)) dziel = 1 tak = 10 suma = 0 cos = liczby for x in range(0, n): liczba = liczby % tak liczby -= liczba tak *= 10 liczba /= dziel suma += liczba dziel *= 10 return int(suma) print(fun(545435433))
def largestNumber(n): ''' Given an integer n, return the largest number that contains exactly n digits. ''' return 10 ** n - 1 print(largestNumber(1)) print(largestNumber(5)) print(largestNumber(10))
def largest_number(n): """ Given an integer n, return the largest number that contains exactly n digits. """ return 10 ** n - 1 print(largest_number(1)) print(largest_number(5)) print(largest_number(10))
class InitializationEventAttribute(Attribute, _Attribute): """ Specifies which event is raised on initialization. This class cannot be inherited. InitializationEventAttribute(eventName: str) """ def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self, eventName): """ __new__(cls: type,eventName: str) """ pass EventName = property(lambda self: object(), lambda self, v: None, lambda self: None) """Gets the name of the initialization event. Get: EventName(self: InitializationEventAttribute) -> str """
class Initializationeventattribute(Attribute, _Attribute): """ Specifies which event is raised on initialization. This class cannot be inherited. InitializationEventAttribute(eventName: str) """ def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self, eventName): """ __new__(cls: type,eventName: str) """ pass event_name = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets the name of the initialization event.\n\n\n\nGet: EventName(self: InitializationEventAttribute) -> str\n\n\n\n'
# -*- coding: utf-8 -*- class Solution: def strStr(self, haystack, needle): return haystack.find(needle) if __name__ == '__main__': solution = Solution() assert 2 == solution.strStr('hello', 'll') assert -1 == solution.strStr('aaaaa', 'bba') assert 0 == solution.strStr('aaaaa', '')
class Solution: def str_str(self, haystack, needle): return haystack.find(needle) if __name__ == '__main__': solution = solution() assert 2 == solution.strStr('hello', 'll') assert -1 == solution.strStr('aaaaa', 'bba') assert 0 == solution.strStr('aaaaa', '')
PARAMS = { "default": { "folders": ["INBOX"], "csvdir": "./data", "outdir": "./trained", }, "suse-manager": { "folders": ["INBOX/suse-manager"], "csvdir": "./suse-manager-data", "outdir": "./suse-manager-trained", } }
params = {'default': {'folders': ['INBOX'], 'csvdir': './data', 'outdir': './trained'}, 'suse-manager': {'folders': ['INBOX/suse-manager'], 'csvdir': './suse-manager-data', 'outdir': './suse-manager-trained'}}
class ArthurContextProperty(ArthurContext): """ Question: We want to find out which context a given word is part of. Possible calculations: 1. Calculate levenshtein distance of given word with all val_samples, then return key of the val_sample with smallest levenshtein distance. 2. If given text follows a certain regex, adds its relevancy score with regex_weight. regex_weight defaults at 0.5, and can be set up manually below. 3. If we have information of text found in pdf right before given word, we can perhaps give weight to associated key, but this is not 100%. Maybe we can try with #1 first and when improvement is needed we can try #2 and #3. For example, consider following ArthurDocumentElements in pdf (subtle differences are intentional): - Community features: - private settings, southern exposures. As levensthein distance is closest when compared with "appliances included", that is the value that will be returned. Different languages may have different rules. We can expand our project by creating other contexts. ## Complications: **1. Key and value could be stored in one line, for example: "View: ocean view".** To deal with this, maybe we can imitate a method used in DNA string comparison, where values found before and after search string are not penalized (see Smith- Waterman algorithm). """ ### Return json text of context. def value(): return """ { "address": { "val_regex": "[,-a-zA-Z0-9 ]", "val_samples": ["3150 Rutland Rd, Victoria, British Columbia V8R4R8"] }, "total_rooms": { "key_location": "right", "key_samples": [{"type": "image", "path": ""}], "val_regex": "[0-9]" }, "total_bathrooms": { "key_location": "right", "key_samples": [{"type": "image", "path": ""}], "val_regex": "[0-9]" }, "property_type": { "key_samples": ["property type"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "single family" ] }, "land_size": { "key_samples": ["land size"], "val_regex": "^[0-9][.0-9a-z ]+", "regex_weight": 0.8, "val_samples": ["0.9065 hec"] }, "building_type": { "key_samples": ["building type"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["house"] }, "built_in": { "key_samples": ["built in"], "val_regex": "[0-9]{4}", "regex_weight": 0.8, "val_samples": ["1914"] }, "title": { "key_samples": ["title"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "freehold" ] }, "appliances_included": { "key_samples": ["appliances included"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "hot tub", "water softener", "central vacuum" ] }, "community_features": { "key_samples": ["community features"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "quiet area" ] }, "features": { "key_samples": ["features"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "cul-de-sac", "private setting", "southern exposure", "wheelchair access" ] }, "view": { "key_samples": ["view"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "view of water", "mountain view", "city view", "ocean view", "lake view" ] }, "parking_type": { "key_samples": ["parking type"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": [ "garage" ] }, "waterfront": { "key_samples": ["waterfront"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["waterfront on ocean"] }, "zoning_id": { "key_samples": ["zoning id"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["residential"] }, "description": { "key_samples": ["description"], "val_regex": "." }, "floor_space": { "key_samples": ["floor space"], "val_regex": "^[0-9][.0-9a-z ]+", "regex_weight": 0.8, "val_samples": ["1025.742 m2"] }, "style": { "key_samples": ["style"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["detached"] }, "walk_score": { "key_samples": ["walk score"], "val_regex": "[0-9]", "regex_weight": 0.8, "val_samples": [6] }, "walk_score_detail": { "key_samples": ["walk score"], "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["car-dependent"] }, "agent_name": { "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["Sylvia", "Therrien"], }, "agent_job_desc": { "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["personal real estate corporation"], }, "agent_company_name": { "val_regex": "[-a-zA-Z0-9 ]", "val_samples": ["newport realty"], }, "agent_company_address": { "val_regex": "[,-a-zA-Z0-9 ]", "val_samples": ["1286 Fairfield Rd", "Victoria, BC V8V4W3"] }, "agent_company_phone": { "key_samples": [{"type": "image", "path": ""}], "val_regex": "[-0-9]", "val_samples": ["250-385-2033"] }, "agent_company_fax": { "key_samples": ["fax:"], "val_regex": "[-0-9]", "val_samples": ["250-385-3763"] } } """
class Arthurcontextproperty(ArthurContext): """ Question: We want to find out which context a given word is part of. Possible calculations: 1. Calculate levenshtein distance of given word with all val_samples, then return key of the val_sample with smallest levenshtein distance. 2. If given text follows a certain regex, adds its relevancy score with regex_weight. regex_weight defaults at 0.5, and can be set up manually below. 3. If we have information of text found in pdf right before given word, we can perhaps give weight to associated key, but this is not 100%. Maybe we can try with #1 first and when improvement is needed we can try #2 and #3. For example, consider following ArthurDocumentElements in pdf (subtle differences are intentional): - Community features: - private settings, southern exposures. As levensthein distance is closest when compared with "appliances included", that is the value that will be returned. Different languages may have different rules. We can expand our project by creating other contexts. ## Complications: **1. Key and value could be stored in one line, for example: "View: ocean view".** To deal with this, maybe we can imitate a method used in DNA string comparison, where values found before and after search string are not penalized (see Smith- Waterman algorithm). """ def value(): return '\n {\n "address": {\n "val_regex": "[,-a-zA-Z0-9 ]",\n "val_samples": ["3150 Rutland Rd, Victoria, British Columbia V8R4R8"]\n },\n "total_rooms": {\n "key_location": "right",\n "key_samples": [{"type": "image", "path": ""}],\n "val_regex": "[0-9]"\n },\n "total_bathrooms": {\n "key_location": "right",\n "key_samples": [{"type": "image", "path": ""}],\n "val_regex": "[0-9]"\n },\n "property_type": {\n "key_samples": ["property type"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "single family"\n ]\n },\n "land_size": {\n "key_samples": ["land size"],\n "val_regex": "^[0-9][.0-9a-z ]+",\n "regex_weight": 0.8,\n "val_samples": ["0.9065 hec"]\n },\n "building_type": {\n "key_samples": ["building type"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["house"]\n },\n "built_in": {\n "key_samples": ["built in"],\n "val_regex": "[0-9]{4}",\n "regex_weight": 0.8,\n "val_samples": ["1914"]\n },\n "title": {\n "key_samples": ["title"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "freehold"\n ]\n },\n "appliances_included": {\n "key_samples": ["appliances included"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "hot tub",\n "water softener",\n "central vacuum"\n ]\n },\n "community_features": {\n "key_samples": ["community features"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "quiet area"\n ]\n },\n "features": {\n "key_samples": ["features"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "cul-de-sac",\n "private setting",\n "southern exposure",\n "wheelchair access"\n ]\n },\n "view": {\n "key_samples": ["view"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "view of water",\n "mountain view",\n "city view",\n "ocean view",\n "lake view"\n ]\n },\n "parking_type": {\n "key_samples": ["parking type"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": [\n "garage"\n ]\n },\n "waterfront": {\n "key_samples": ["waterfront"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["waterfront on ocean"]\n },\n "zoning_id": {\n "key_samples": ["zoning id"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["residential"]\n },\n "description": {\n "key_samples": ["description"],\n "val_regex": "."\n },\n "floor_space": {\n "key_samples": ["floor space"],\n "val_regex": "^[0-9][.0-9a-z ]+",\n "regex_weight": 0.8,\n "val_samples": ["1025.742 m2"]\n },\n "style": {\n "key_samples": ["style"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["detached"]\n },\n "walk_score": {\n "key_samples": ["walk score"],\n "val_regex": "[0-9]",\n "regex_weight": 0.8,\n "val_samples": [6]\n },\n "walk_score_detail": {\n "key_samples": ["walk score"],\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["car-dependent"]\n },\n "agent_name": {\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["Sylvia", "Therrien"],\n },\n "agent_job_desc": {\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["personal real estate corporation"],\n },\n "agent_company_name": {\n "val_regex": "[-a-zA-Z0-9 ]",\n "val_samples": ["newport realty"],\n },\n "agent_company_address": {\n "val_regex": "[,-a-zA-Z0-9 ]",\n "val_samples": ["1286 Fairfield Rd", "Victoria, BC V8V4W3"]\n },\n "agent_company_phone": {\n "key_samples": [{"type": "image", "path": ""}],\n "val_regex": "[-0-9]",\n "val_samples": ["250-385-2033"]\n },\n "agent_company_fax": {\n "key_samples": ["fax:"],\n "val_regex": "[-0-9]",\n "val_samples": ["250-385-3763"]\n }\n }\n '
#!/usr/bin/python3 SYMBOL_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345678"+ \ "90 !?." LEN_SYM_TABLE = len(SYMBOL_TABLE) print("[+] Length of Symbol table is {}".format(LEN_SYM_TABLE)) def decrypt(c_message, key): plaintext = [] for ch in c_message: pos = SYMBOL_TABLE.find(ch) if pos == -1: plaintext.append(ch) continue if pos - key < 0: pos = (pos - key) + LEN_SYM_TABLE else: pos = (pos - key) plaintext.append(SYMBOL_TABLE[pos]) return ''.join(plaintext) ## bruteforce across keylength of SYMBOL_TABLE def bruteForceCaeserCipher(message): for key in range(LEN_SYM_TABLE): print("Key: {} -- {}".format(key,decrypt(message,key))) if __name__ == '__main__': message = "avnl1olyD4l'ylDohww6DhzDjhuDil" bruteForceCaeserCipher(message)
symbol_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345678' + '90 !?.' len_sym_table = len(SYMBOL_TABLE) print('[+] Length of Symbol table is {}'.format(LEN_SYM_TABLE)) def decrypt(c_message, key): plaintext = [] for ch in c_message: pos = SYMBOL_TABLE.find(ch) if pos == -1: plaintext.append(ch) continue if pos - key < 0: pos = pos - key + LEN_SYM_TABLE else: pos = pos - key plaintext.append(SYMBOL_TABLE[pos]) return ''.join(plaintext) def brute_force_caeser_cipher(message): for key in range(LEN_SYM_TABLE): print('Key: {} -- {}'.format(key, decrypt(message, key))) if __name__ == '__main__': message = "avnl1olyD4l'ylDohww6DhzDjhuDil" brute_force_caeser_cipher(message)
def try_describe_request(command): if isinstance(command, list) and len(command) == 3: command_type = command[0] if command_type == 4: player_key = command[1] actions = command[2] # known action samples # [2, id, (target x, y), ?power] # [1, id] - destruct # [0, id, (x, y)] - change speed return { 'command_type': command_type, 'player_key': player_key, 'actions': actions } else: return command return command def try_describe_ship(ship): if len(ship) != 8: return ship d = {} d['role'] = ship[0] d['id'] = ship[1] d['pos'] = ship[2] d['speed'] = ship[3] d['params'] = { 'remaining fuely': ship[4][0], 'max shot power': ship[4][1], 'heat decrease rate': ship[4][2], 'ships count': ship[4][3], } d['heat'] = ship[5] d['max heat'] = ship[6] d['unk8'] = ship[7] return d def try_describe_game_state(state): if len(state) != 3: return state d = {} d['step'] = state[0] d['unk2'] = state[1] d['ships'] = [ { 'ship': try_describe_ship(block[0]), 'commands': block[1] } for block in state[2]] return d def try_describe_game_params(params): if len(params) != 5: return params d = {} d['max time'] = params[0] d['is_defender'] = params[1] d['unk3'] = params[2] d['?planet params'] = params[3] d['enemy init ship params?? (only attacker??)'] = params[4] return d def try_describe_response(response): if isinstance(response, list) and len(response) == 4: d = {} d['success'] = response[0] d['game_state'] = response[1] d['game params'] = try_describe_game_params(response[2]) d['game state'] = try_describe_game_state(response[3]) return d else: return response
def try_describe_request(command): if isinstance(command, list) and len(command) == 3: command_type = command[0] if command_type == 4: player_key = command[1] actions = command[2] return {'command_type': command_type, 'player_key': player_key, 'actions': actions} else: return command return command def try_describe_ship(ship): if len(ship) != 8: return ship d = {} d['role'] = ship[0] d['id'] = ship[1] d['pos'] = ship[2] d['speed'] = ship[3] d['params'] = {'remaining fuely': ship[4][0], 'max shot power': ship[4][1], 'heat decrease rate': ship[4][2], 'ships count': ship[4][3]} d['heat'] = ship[5] d['max heat'] = ship[6] d['unk8'] = ship[7] return d def try_describe_game_state(state): if len(state) != 3: return state d = {} d['step'] = state[0] d['unk2'] = state[1] d['ships'] = [{'ship': try_describe_ship(block[0]), 'commands': block[1]} for block in state[2]] return d def try_describe_game_params(params): if len(params) != 5: return params d = {} d['max time'] = params[0] d['is_defender'] = params[1] d['unk3'] = params[2] d['?planet params'] = params[3] d['enemy init ship params?? (only attacker??)'] = params[4] return d def try_describe_response(response): if isinstance(response, list) and len(response) == 4: d = {} d['success'] = response[0] d['game_state'] = response[1] d['game params'] = try_describe_game_params(response[2]) d['game state'] = try_describe_game_state(response[3]) return d else: return response
class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ if x < 0 : return False elif x < 10: return True else: strx = str(x) i = 0 j = len(strx) - 1 while i < j: if strx[i] != strx[j]: return False i += 1 j -= 1 return True
class Solution(object): def is_palindrome(self, x): """ :type x: int :rtype: bool """ if x < 0: return False elif x < 10: return True else: strx = str(x) i = 0 j = len(strx) - 1 while i < j: if strx[i] != strx[j]: return False i += 1 j -= 1 return True
# Day 10 - Search Insert Position # Naive class Solution: def searchInsert(self, nums: List[int], target: int) -> int: for i, num in enumerate(nums): if target <= num: return i return len(nums) # Binary Search class Solution: def searchInsert(self, nums: List[int], target: int) -> int: l, r = 0, len(nums) while l < r: m = (l + r) // 2 if nums[m] < target: l = m + 1 elif target <= nums[m]: r = m return l
class Solution: def search_insert(self, nums: List[int], target: int) -> int: for (i, num) in enumerate(nums): if target <= num: return i return len(nums) class Solution: def search_insert(self, nums: List[int], target: int) -> int: (l, r) = (0, len(nums)) while l < r: m = (l + r) // 2 if nums[m] < target: l = m + 1 elif target <= nums[m]: r = m return l
# Copyright 2014 Rackspace # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. LB_ALGORITHM_ROUND_ROBIN = 'ROUND_ROBIN' LB_ALGORITHM_LEAST_CONNECTIONS = 'LEAST_CONNECTIONS' LB_ALGORITHM_SOURCE_IP = 'SOURCE_IP' SUPPORTED_LB_ALGORITHMS = (LB_ALGORITHM_LEAST_CONNECTIONS, LB_ALGORITHM_ROUND_ROBIN, LB_ALGORITHM_SOURCE_IP) SESSION_PERSISTENCE_SOURCE_IP = 'SOURCE_IP' SESSION_PERSISTENCE_HTTP_COOKIE = 'HTTP_COOKIE' SESSION_PERSISTENCE_APP_COOKIE = 'APP_COOKIE' SUPPORTED_SP_TYPES = (SESSION_PERSISTENCE_SOURCE_IP, SESSION_PERSISTENCE_HTTP_COOKIE, SESSION_PERSISTENCE_APP_COOKIE) HEALTH_MONITOR_PING = 'PING' HEALTH_MONITOR_TCP = 'TCP' HEALTH_MONITOR_HTTP = 'HTTP' HEALTH_MONITOR_HTTPS = 'HTTPS' HEALTH_MONITOR_TLS_HELLO = 'TLS-HELLO' HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT' SUPPORTED_HEALTH_MONITOR_TYPES = (HEALTH_MONITOR_HTTP, HEALTH_MONITOR_HTTPS, HEALTH_MONITOR_PING, HEALTH_MONITOR_TCP, HEALTH_MONITOR_TLS_HELLO, HEALTH_MONITOR_UDP_CONNECT) HEALTH_MONITOR_HTTP_METHOD_GET = 'GET' HEALTH_MONITOR_HTTP_METHOD_HEAD = 'HEAD' HEALTH_MONITOR_HTTP_METHOD_POST = 'POST' HEALTH_MONITOR_HTTP_METHOD_PUT = 'PUT' HEALTH_MONITOR_HTTP_METHOD_DELETE = 'DELETE' HEALTH_MONITOR_HTTP_METHOD_TRACE = 'TRACE' HEALTH_MONITOR_HTTP_METHOD_OPTIONS = 'OPTIONS' HEALTH_MONITOR_HTTP_METHOD_CONNECT = 'CONNECT' HEALTH_MONITOR_HTTP_METHOD_PATCH = 'PATCH' HEALTH_MONITOR_HTTP_DEFAULT_METHOD = HEALTH_MONITOR_HTTP_METHOD_GET SUPPORTED_HEALTH_MONITOR_HTTP_METHODS = ( HEALTH_MONITOR_HTTP_METHOD_GET, HEALTH_MONITOR_HTTP_METHOD_HEAD, HEALTH_MONITOR_HTTP_METHOD_POST, HEALTH_MONITOR_HTTP_METHOD_PUT, HEALTH_MONITOR_HTTP_METHOD_DELETE, HEALTH_MONITOR_HTTP_METHOD_TRACE, HEALTH_MONITOR_HTTP_METHOD_OPTIONS, HEALTH_MONITOR_HTTP_METHOD_CONNECT, HEALTH_MONITOR_HTTP_METHOD_PATCH) HEALTH_MONITOR_DEFAULT_EXPECTED_CODES = '200' HEALTH_MONITOR_DEFAULT_URL_PATH = '/' TYPE = 'type' URL_PATH = 'url_path' HTTP_METHOD = 'http_method' EXPECTED_CODES = 'expected_codes' DELAY = 'delay' TIMEOUT = 'timeout' MAX_RETRIES = 'max_retries' RISE_THRESHOLD = 'rise_threshold' UPDATE_STATS = 'UPDATE_STATS' UPDATE_HEALTH = 'UPDATE_HEALTH' PROTOCOL_TCP = 'TCP' PROTOCOL_UDP = 'UDP' PROTOCOL_HTTP = 'HTTP' PROTOCOL_HTTPS = 'HTTPS' PROTOCOL_TERMINATED_HTTPS = 'TERMINATED_HTTPS' PROTOCOL_PROXY = 'PROXY' SUPPORTED_PROTOCOLS = (PROTOCOL_TCP, PROTOCOL_HTTPS, PROTOCOL_HTTP, PROTOCOL_TERMINATED_HTTPS, PROTOCOL_PROXY, PROTOCOL_UDP) VALID_LISTENER_POOL_PROTOCOL_MAP = { PROTOCOL_TCP: [PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_PROXY, PROTOCOL_TCP], PROTOCOL_HTTP: [PROTOCOL_HTTP, PROTOCOL_PROXY], PROTOCOL_HTTPS: [PROTOCOL_HTTPS, PROTOCOL_PROXY, PROTOCOL_TCP], PROTOCOL_TERMINATED_HTTPS: [PROTOCOL_HTTP, PROTOCOL_PROXY], PROTOCOL_UDP: [PROTOCOL_UDP]} # API Integer Ranges MIN_PORT_NUMBER = 1 MAX_PORT_NUMBER = 65535 DEFAULT_CONNECTION_LIMIT = -1 MIN_CONNECTION_LIMIT = -1 DEFAULT_WEIGHT = 1 MIN_WEIGHT = 0 MAX_WEIGHT = 256 MIN_HM_RETRIES = 1 MAX_HM_RETRIES = 10 # 1 year: y d h m ms MAX_TIMEOUT = 365 * 24 * 60 * 60 * 1000 MIN_TIMEOUT = 0 DEFAULT_TIMEOUT_CLIENT_DATA = 50000 DEFAULT_TIMEOUT_MEMBER_CONNECT = 5000 DEFAULT_TIMEOUT_MEMBER_DATA = 50000 DEFAULT_TIMEOUT_TCP_INSPECT = 0 # Note: The database Amphora table has a foreign key constraint against # the provisioning_status table # Amphora has been allocated to a load balancer AMPHORA_ALLOCATED = 'ALLOCATED' # Amphora is being built AMPHORA_BOOTING = 'BOOTING' # Amphora is ready to be allocated to a load balancer AMPHORA_READY = 'READY' ACTIVE = 'ACTIVE' PENDING_DELETE = 'PENDING_DELETE' PENDING_UPDATE = 'PENDING_UPDATE' PENDING_CREATE = 'PENDING_CREATE' DELETED = 'DELETED' ERROR = 'ERROR' SUPPORTED_PROVISIONING_STATUSES = (ACTIVE, AMPHORA_ALLOCATED, AMPHORA_BOOTING, AMPHORA_READY, PENDING_DELETE, PENDING_CREATE, PENDING_UPDATE, DELETED, ERROR) MUTABLE_STATUSES = (ACTIVE,) DELETABLE_STATUSES = (ACTIVE, ERROR) FAILOVERABLE_STATUSES = (ACTIVE, ERROR) SUPPORTED_AMPHORA_STATUSES = (AMPHORA_ALLOCATED, AMPHORA_BOOTING, ERROR, AMPHORA_READY, DELETED, PENDING_CREATE, PENDING_DELETE) ONLINE = 'ONLINE' OFFLINE = 'OFFLINE' DEGRADED = 'DEGRADED' ERROR = 'ERROR' DRAINING = 'DRAINING' NO_MONITOR = 'NO_MONITOR' OPERATING_STATUS = 'operating_status' PROVISIONING_STATUS = 'provisioning_status' SUPPORTED_OPERATING_STATUSES = (ONLINE, OFFLINE, DEGRADED, ERROR, DRAINING, NO_MONITOR) AMPHORA_VM = 'VM' SUPPORTED_AMPHORA_TYPES = (AMPHORA_VM,) # L7 constants L7RULE_TYPE_HOST_NAME = 'HOST_NAME' L7RULE_TYPE_PATH = 'PATH' L7RULE_TYPE_FILE_TYPE = 'FILE_TYPE' L7RULE_TYPE_HEADER = 'HEADER' L7RULE_TYPE_COOKIE = 'COOKIE' SUPPORTED_L7RULE_TYPES = (L7RULE_TYPE_HOST_NAME, L7RULE_TYPE_PATH, L7RULE_TYPE_FILE_TYPE, L7RULE_TYPE_HEADER, L7RULE_TYPE_COOKIE) L7RULE_COMPARE_TYPE_REGEX = 'REGEX' L7RULE_COMPARE_TYPE_STARTS_WITH = 'STARTS_WITH' L7RULE_COMPARE_TYPE_ENDS_WITH = 'ENDS_WITH' L7RULE_COMPARE_TYPE_CONTAINS = 'CONTAINS' L7RULE_COMPARE_TYPE_EQUAL_TO = 'EQUAL_TO' SUPPORTED_L7RULE_COMPARE_TYPES = (L7RULE_COMPARE_TYPE_REGEX, L7RULE_COMPARE_TYPE_STARTS_WITH, L7RULE_COMPARE_TYPE_ENDS_WITH, L7RULE_COMPARE_TYPE_CONTAINS, L7RULE_COMPARE_TYPE_EQUAL_TO) L7POLICY_ACTION_REJECT = 'REJECT' L7POLICY_ACTION_REDIRECT_TO_URL = 'REDIRECT_TO_URL' L7POLICY_ACTION_REDIRECT_TO_POOL = 'REDIRECT_TO_POOL' SUPPORTED_L7POLICY_ACTIONS = (L7POLICY_ACTION_REJECT, L7POLICY_ACTION_REDIRECT_TO_URL, L7POLICY_ACTION_REDIRECT_TO_POOL) MIN_POLICY_POSITION = 1 # Largest a 32-bit integer can be, which is a limitation # here if you're using MySQL, as most probably are. This just needs # to be larger than any existing rule position numbers which will # definitely be the case with 2147483647 MAX_POLICY_POSITION = 2147483647 # Testing showed haproxy config failed to parse after more than # 53 rules per policy MAX_L7RULES_PER_L7POLICY = 50 # See RFCs 2616, 2965, 6265, 7230: Should match characters valid in a # http header or cookie name. HTTP_HEADER_NAME_REGEX = r'\A[a-zA-Z0-9!#$%&\'*+-.^_`|~]+\Z' # See RFCs 2616, 2965, 6265: Should match characters valid in a cookie value. HTTP_COOKIE_VALUE_REGEX = r'\A[a-zA-Z0-9!#$%&\'()*+-./:<=>?@[\]^_`{|}~]+\Z' # See RFC 7230: Should match characters valid in a header value. HTTP_HEADER_VALUE_REGEX = (r'\A[a-zA-Z0-9' r'!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~\\]+\Z') # Also in RFC 7230: Should match characters valid in a header value # when quoted with double quotes. HTTP_QUOTED_HEADER_VALUE_REGEX = (r'\A"[a-zA-Z0-9 \t' r'!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~\\]*"\Z') # Task/Flow constants AMPHORA = 'amphora' FAILED_AMPHORA = 'failed_amphora' FAILOVER_AMPHORA = 'failover_amphora' AMPHORAE = 'amphorae' AMPHORA_ID = 'amphora_id' AMPHORA_INDEX = 'amphora_index' FAILOVER_AMPHORA_ID = 'failover_amphora_id' DELTA = 'delta' DELTAS = 'deltas' HEALTH_MON = 'health_mon' HEALTH_MONITOR = 'health_monitor' LISTENER = 'listener' LISTENERS = 'listeners' LISTENER_ID = 'listener_id' LOADBALANCER = 'loadbalancer' LOADBALANCERS = 'loadbalancers' LOADBALANCER_ID = 'loadbalancer_id' LOAD_BALANCER_ID = 'load_balancer_id' SERVER_GROUP_ID = 'server_group_id' ANTI_AFFINITY = 'anti-affinity' SOFT_ANTI_AFFINITY = 'soft-anti-affinity' MEMBER = 'member' MEMBERS = 'members' MEMBER_ID = 'member_id' COMPUTE_ID = 'compute_id' COMPUTE_OBJ = 'compute_obj' AMP_DATA = 'amp_data' AMPS_DATA = 'amps_data' NICS = 'nics' VIP = 'vip' POOL = 'pool' POOLS = 'pools' POOL_CHILD_COUNT = 'pool_child_count' POOL_ID = 'pool_id' L7POLICY = 'l7policy' L7RULE = 'l7rule' OBJECT = 'object' SERVER_PEM = 'server_pem' UPDATE_DICT = 'update_dict' VIP_NETWORK = 'vip_network' AMPHORAE_NETWORK_CONFIG = 'amphorae_network_config' ADDED_PORTS = 'added_ports' PORTS = 'ports' MEMBER_PORTS = 'member_ports' LOADBALANCER_TOPOLOGY = 'topology' HEALTHMONITORS = 'healthmonitors' HEALTH_MONITOR_ID = 'health_monitor_id' L7POLICIES = 'l7policies' L7POLICY_ID = 'l7policy_id' L7RULES = 'l7rules' L7RULE_ID = 'l7rule_id' LOAD_BALANCER_UPDATES = 'load_balancer_updates' LISTENER_UPDATES = 'listener_updates' POOL_UPDATES = 'pool_updates' MEMBER_UPDATES = 'member_updates' HEALTH_MONITOR_UPDATES = 'health_monitor_updates' L7POLICY_UPDATES = 'l7policy_updates' L7RULE_UPDATES = 'l7rule_updates' TIMEOUT_DICT = 'timeout_dict' REQ_CONN_TIMEOUT = 'req_conn_timeout' REQ_READ_TIMEOUT = 'req_read_timeout' CONN_MAX_RETRIES = 'conn_max_retries' CONN_RETRY_INTERVAL = 'conn_retry_interval' CERT_ROTATE_AMPHORA_FLOW = 'octavia-cert-rotate-amphora-flow' CREATE_AMPHORA_FLOW = 'octavia-create-amphora-flow' CREATE_AMPHORA_FOR_LB_FLOW = 'octavia-create-amp-for-lb-flow' CREATE_HEALTH_MONITOR_FLOW = 'octavia-create-health-monitor-flow' CREATE_LISTENER_FLOW = 'octavia-create-listener_flow' PRE_CREATE_LOADBALANCER_FLOW = 'octavia-pre-create-loadbalancer-flow' CREATE_SERVER_GROUP_FLOW = 'octavia-create-server-group-flow' UPDATE_LB_SERVERGROUPID_FLOW = 'octavia-update-lb-server-group-id-flow' CREATE_LISTENERS_FLOW = 'octavia-create-all-listeners-flow' CREATE_LOADBALANCER_FLOW = 'octavia-create-loadbalancer-flow' CREATE_LOADBALANCER_GRAPH_FLOW = 'octavia-create-loadbalancer-graph-flow' CREATE_MEMBER_FLOW = 'octavia-create-member-flow' CREATE_POOL_FLOW = 'octavia-create-pool-flow' CREATE_L7POLICY_FLOW = 'octavia-create-l7policy-flow' CREATE_L7RULE_FLOW = 'octavia-create-l7rule-flow' DELETE_AMPHORA_FLOW = 'octavia-delete-amphora-flow' DELETE_HEALTH_MONITOR_FLOW = 'octavia-delete-health-monitor-flow' DELETE_LISTENER_FLOW = 'octavia-delete-listener_flow' DELETE_LOADBALANCER_FLOW = 'octavia-delete-loadbalancer-flow' DELETE_MEMBER_FLOW = 'octavia-delete-member-flow' DELETE_POOL_FLOW = 'octavia-delete-pool-flow' DELETE_L7POLICY_FLOW = 'octavia-delete-l7policy-flow' DELETE_L7RULE_FLOW = 'octavia-delete-l7policy-flow' FAILOVER_AMPHORA_FLOW = 'octavia-failover-amphora-flow' LOADBALANCER_NETWORKING_SUBFLOW = 'octavia-new-loadbalancer-net-subflow' UPDATE_HEALTH_MONITOR_FLOW = 'octavia-update-health-monitor-flow' UPDATE_LISTENER_FLOW = 'octavia-update-listener-flow' UPDATE_LOADBALANCER_FLOW = 'octavia-update-loadbalancer-flow' UPDATE_MEMBER_FLOW = 'octavia-update-member-flow' UPDATE_POOL_FLOW = 'octavia-update-pool-flow' UPDATE_L7POLICY_FLOW = 'octavia-update-l7policy-flow' UPDATE_L7RULE_FLOW = 'octavia-update-l7rule-flow' UPDATE_AMPS_SUBFLOW = 'octavia-update-amps-subflow' POST_MAP_AMP_TO_LB_SUBFLOW = 'octavia-post-map-amp-to-lb-subflow' CREATE_AMP_FOR_LB_SUBFLOW = 'octavia-create-amp-for-lb-subflow' GET_AMPHORA_FOR_LB_SUBFLOW = 'octavia-get-amphora-for-lb-subflow' POST_LB_AMP_ASSOCIATION_SUBFLOW = ( 'octavia-post-loadbalancer-amp_association-subflow') MAP_LOADBALANCER_TO_AMPHORA = 'octavia-mapload-balancer-to-amphora' RELOAD_AMPHORA = 'octavia-reload-amphora' CREATE_AMPHORA_INDB = 'octavia-create-amphora-indb' GENERATE_SERVER_PEM = 'octavia-generate-serverpem' UPDATE_CERT_EXPIRATION = 'octavia-update-cert-expiration' CERT_COMPUTE_CREATE = 'octavia-cert-compute-create' COMPUTE_CREATE = 'octavia-compute-create' UPDATE_AMPHORA_COMPUTEID = 'octavia-update-amphora-computeid' MARK_AMPHORA_BOOTING_INDB = 'octavia-mark-amphora-booting-indb' WAIT_FOR_AMPHORA = 'octavia-wait_for_amphora' COMPUTE_WAIT = 'octavia-compute-wait' UPDATE_AMPHORA_INFO = 'octavia-update-amphora-info' AMPHORA_FINALIZE = 'octavia-amphora-finalize' MARK_AMPHORA_ALLOCATED_INDB = 'octavia-mark-amphora-allocated-indb' RELOADLOAD_BALANCER = 'octavia-reloadload-balancer' MARK_LB_ACTIVE_INDB = 'octavia-mark-lb-active-indb' MARK_AMP_MASTER_INDB = 'octavia-mark-amp-master-indb' MARK_AMP_BACKUP_INDB = 'octavia-mark-amp-backup-indb' MARK_AMP_STANDALONE_INDB = 'octavia-mark-amp-standalone-indb' GET_VRRP_SUBFLOW = 'octavia-get-vrrp-subflow' AMP_VRRP_UPDATE = 'octavia-amphora-vrrp-update' AMP_VRRP_START = 'octavia-amphora-vrrp-start' AMP_VRRP_STOP = 'octavia-amphora-vrrp-stop' AMP_UPDATE_VRRP_INTF = 'octavia-amphora-update-vrrp-intf' CREATE_VRRP_GROUP_FOR_LB = 'octavia-create-vrrp-group-for-lb' CREATE_VRRP_SECURITY_RULES = 'octavia-create-vrrp-security-rules' AMP_COMPUTE_CONNECTIVITY_WAIT = 'octavia-amp-compute-connectivity-wait' AMP_LISTENER_UPDATE = 'octavia-amp-listeners-update' GENERATE_SERVER_PEM_TASK = 'GenerateServerPEMTask' # Batch Member Update constants MEMBERS = 'members' UNORDERED_MEMBER_UPDATES_FLOW = 'octavia-unordered-member-updates-flow' UNORDERED_MEMBER_ACTIVE_FLOW = 'octavia-unordered-member-active-flow' UPDATE_ATTRIBUTES_FLOW = 'octavia-update-attributes-flow' DELETE_MODEL_OBJECT_FLOW = 'octavia-delete-model-object-flow' BATCH_UPDATE_MEMBERS_FLOW = 'octavia-batch-update-members-flow' MEMBER_TO_ERROR_ON_REVERT_FLOW = 'octavia-member-to-error-on-revert-flow' DECREMENT_MEMBER_QUOTA_FLOW = 'octavia-decrement-member-quota-flow' MARK_MEMBER_ACTIVE_INDB = 'octavia-mark-member-active-indb' UPDATE_MEMBER_INDB = 'octavia-update-member-indb' DELETE_MEMBER_INDB = 'octavia-delete-member-indb' # Task Names RELOAD_LB_AFTER_AMP_ASSOC = 'reload-lb-after-amp-assoc' RELOAD_LB_AFTER_AMP_ASSOC_FULL_GRAPH = 'reload-lb-after-amp-assoc-full-graph' RELOAD_LB_AFTER_PLUG_VIP = 'reload-lb-after-plug-vip' NOVA_1 = '1.1' NOVA_21 = '2.1' NOVA_3 = '3' NOVA_VERSIONS = (NOVA_1, NOVA_21, NOVA_3) # Auth sections SERVICE_AUTH = 'service_auth' RPC_NAMESPACE_CONTROLLER_AGENT = 'controller' # Build Type Priority LB_CREATE_FAILOVER_PRIORITY = 20 LB_CREATE_NORMAL_PRIORITY = 40 LB_CREATE_SPARES_POOL_PRIORITY = 60 LB_CREATE_ADMIN_FAILOVER_PRIORITY = 80 BUILD_TYPE_PRIORITY = 'build_type_priority' # Active standalone roles and topology TOPOLOGY_SINGLE = 'SINGLE' TOPOLOGY_ACTIVE_STANDBY = 'ACTIVE_STANDBY' ROLE_MASTER = 'MASTER' ROLE_BACKUP = 'BACKUP' ROLE_STANDALONE = 'STANDALONE' SUPPORTED_LB_TOPOLOGIES = (TOPOLOGY_ACTIVE_STANDBY, TOPOLOGY_SINGLE) SUPPORTED_AMPHORA_ROLES = (ROLE_BACKUP, ROLE_MASTER, ROLE_STANDALONE) TOPOLOGY_STATUS_OK = 'OK' ROLE_MASTER_PRIORITY = 100 ROLE_BACKUP_PRIORITY = 90 VRRP_AUTH_DEFAULT = 'PASS' VRRP_AUTH_AH = 'AH' SUPPORTED_VRRP_AUTH = (VRRP_AUTH_DEFAULT, VRRP_AUTH_AH) KEEPALIVED_CMD = '/usr/sbin/keepalived ' # The DEFAULT_VRRP_ID value needs to be variable for multi tenant support # per amphora in the future DEFAULT_VRRP_ID = 1 VRRP_PROTOCOL_NUM = 112 AUTH_HEADER_PROTOCOL_NUMBER = 51 TEMPLATES = '/templates' AGENT_API_TEMPLATES = '/templates' AGENT_CONF_TEMPLATE = 'amphora_agent_conf.template' USER_DATA_CONFIG_DRIVE_TEMPLATE = 'user_data_config_drive.template' OPEN = 'OPEN' FULL = 'FULL' # OPEN = HAProxy listener status nbconn < maxconn # FULL = HAProxy listener status not nbconn < maxconn HAPROXY_LISTENER_STATUSES = (OPEN, FULL) UP = 'UP' DOWN = 'DOWN' # UP = HAProxy backend has working or no servers # DOWN = HAProxy backend has no working servers HAPROXY_BACKEND_STATUSES = (UP, DOWN) DRAIN = 'DRAIN' MAINT = 'MAINT' NO_CHECK = 'no check' # DRAIN = member is weight 0 and is in draining mode # MAINT = member is downed for maintenance? not sure when this happens # NO_CHECK = no health monitor is enabled HAPROXY_MEMBER_STATUSES = (UP, DOWN, DRAIN, MAINT, NO_CHECK) # Current maximum number of conccurent connections in HAProxy. # This is limited by the systemd "LimitNOFILE" and # the sysctl fs.file-max fs.nr_open settings in the image HAPROXY_MAX_MAXCONN = 1000000 # Quota Constants QUOTA_UNLIMITED = -1 MIN_QUOTA = QUOTA_UNLIMITED MAX_QUOTA = 2000000000 API_VERSION = '0.5' NOOP_EVENT_STREAMER = 'noop_event_streamer' HAPROXY_BASE_PEER_PORT = 1025 KEEPALIVED_JINJA2_UPSTART = 'keepalived.upstart.j2' KEEPALIVED_JINJA2_SYSTEMD = 'keepalived.systemd.j2' KEEPALIVED_JINJA2_SYSVINIT = 'keepalived.sysvinit.j2' CHECK_SCRIPT_CONF = 'keepalived_check_script.conf.j2' KEEPALIVED_CHECK_SCRIPT = 'keepalived_lvs_check_script.sh.j2' PLUGGED_INTERFACES = '/var/lib/octavia/plugged_interfaces' HAPROXY_USER_GROUP_CFG = '/var/lib/octavia/haproxy-default-user-group.conf' AMPHORA_NAMESPACE = 'amphora-haproxy' # List of HTTP headers which are supported for insertion SUPPORTED_HTTP_HEADERS = ['X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto'] FLOW_DOC_TITLES = {'AmphoraFlows': 'Amphora Flows', 'LoadBalancerFlows': 'Load Balancer Flows', 'ListenerFlows': 'Listener Flows', 'PoolFlows': 'Pool Flows', 'MemberFlows': 'Member Flows', 'HealthMonitorFlows': 'Health Monitor Flows', 'L7PolicyFlows': 'Layer 7 Policy Flows', 'L7RuleFlows': 'Layer 7 Rule Flows'} NETNS_PRIMARY_INTERFACE = 'eth1' SYSCTL_CMD = '/sbin/sysctl' AMP_ACTION_START = 'start' AMP_ACTION_STOP = 'stop' AMP_ACTION_RELOAD = 'reload' AMP_ACTION_RESTART = 'restart' GLANCE_IMAGE_ACTIVE = 'active' INIT_SYSTEMD = 'systemd' INIT_UPSTART = 'upstart' INIT_SYSVINIT = 'sysvinit' INIT_UNKOWN = 'unknown' VALID_INIT_SYSTEMS = (INIT_SYSTEMD, INIT_SYSVINIT, INIT_UPSTART) INIT_PATH = '/sbin/init' SYSTEMD_DIR = '/usr/lib/systemd/system' SYSVINIT_DIR = '/etc/init.d' UPSTART_DIR = '/etc/init' INIT_PROC_COMM_PATH = '/proc/1/comm' KEEPALIVED_SYSTEMD = 'octavia-keepalived.service' KEEPALIVED_SYSVINIT = 'octavia-keepalived' KEEPALIVED_UPSTART = 'octavia-keepalived.conf' KEEPALIVED_SYSTEMD_PREFIX = 'octavia-keepalivedlvs-%s.service' KEEPALIVED_SYSVINIT_PREFIX = 'octavia-keepalivedlvs-%s' KEEPALIVED_UPSTART_PREFIX = 'octavia-keepalivedlvs-%s.conf' # Authentication KEYSTONE = 'keystone' NOAUTH = 'noauth' TESTING = 'testing' # Amphora distro-specific data UBUNTU_AMP_NET_DIR_TEMPLATE = '/etc/netns/{netns}/network/interfaces.d/' RH_AMP_NET_DIR_TEMPLATE = '/etc/netns/{netns}/sysconfig/network-scripts/' UBUNTU = 'ubuntu' CENTOS = 'centos' # Pagination, sorting, filtering values APPLICATION_JSON = 'application/json' PAGINATION_HELPER = 'pagination_helper' ASC = 'asc' DESC = 'desc' ALLOWED_SORT_DIR = (ASC, DESC) DEFAULT_SORT_DIR = ASC DEFAULT_SORT_KEYS = ['created_at', 'id'] DEFAULT_PAGE_SIZE = 1000 # RBAC LOADBALANCER_API = 'os_load-balancer_api' RULE_API_ADMIN = 'rule:load-balancer:admin' RULE_API_READ = 'rule:load-balancer:read' RULE_API_READ_GLOBAL = 'rule:load-balancer:read-global' RULE_API_WRITE = 'rule:load-balancer:write' RULE_API_READ_QUOTA = 'rule:load-balancer:read-quota' RULE_API_READ_QUOTA_GLOBAL = 'rule:load-balancer:read-quota-global' RULE_API_WRITE_QUOTA = 'rule:load-balancer:write-quota' RBAC_LOADBALANCER = '{}:loadbalancer:'.format(LOADBALANCER_API) RBAC_LISTENER = '{}:listener:'.format(LOADBALANCER_API) RBAC_POOL = '{}:pool:'.format(LOADBALANCER_API) RBAC_MEMBER = '{}:member:'.format(LOADBALANCER_API) RBAC_HEALTHMONITOR = '{}:healthmonitor:'.format(LOADBALANCER_API) RBAC_L7POLICY = '{}:l7policy:'.format(LOADBALANCER_API) RBAC_L7RULE = '{}:l7rule:'.format(LOADBALANCER_API) RBAC_QUOTA = '{}:quota:'.format(LOADBALANCER_API) RBAC_AMPHORA = '{}:amphora:'.format(LOADBALANCER_API) RBAC_PROVIDER = '{}:provider:'.format(LOADBALANCER_API) RBAC_POST = 'post' RBAC_PUT = 'put' RBAC_PUT_FAILOVER = 'put_failover' RBAC_DELETE = 'delete' RBAC_GET_ONE = 'get_one' RBAC_GET_ALL = 'get_all' RBAC_GET_ALL_GLOBAL = 'get_all-global' RBAC_GET_DEFAULTS = 'get_defaults' RBAC_GET_STATS = 'get_stats' RBAC_GET_STATUS = 'get_status' # PROVIDERS # TODO(johnsom) When providers are implemented, this should be removed. OCTAVIA = 'octavia' # FLAVORS # TODO(johnsom) When flavors are implemented, this should be removed. SUPPORTED_FLAVORS = () # systemctl commands DISABLE = 'disable' ENABLE = 'enable' # systemd amphora netns service prefix AMP_NETNS_SVC_PREFIX = 'amphora-netns'
lb_algorithm_round_robin = 'ROUND_ROBIN' lb_algorithm_least_connections = 'LEAST_CONNECTIONS' lb_algorithm_source_ip = 'SOURCE_IP' supported_lb_algorithms = (LB_ALGORITHM_LEAST_CONNECTIONS, LB_ALGORITHM_ROUND_ROBIN, LB_ALGORITHM_SOURCE_IP) session_persistence_source_ip = 'SOURCE_IP' session_persistence_http_cookie = 'HTTP_COOKIE' session_persistence_app_cookie = 'APP_COOKIE' supported_sp_types = (SESSION_PERSISTENCE_SOURCE_IP, SESSION_PERSISTENCE_HTTP_COOKIE, SESSION_PERSISTENCE_APP_COOKIE) health_monitor_ping = 'PING' health_monitor_tcp = 'TCP' health_monitor_http = 'HTTP' health_monitor_https = 'HTTPS' health_monitor_tls_hello = 'TLS-HELLO' health_monitor_udp_connect = 'UDP-CONNECT' supported_health_monitor_types = (HEALTH_MONITOR_HTTP, HEALTH_MONITOR_HTTPS, HEALTH_MONITOR_PING, HEALTH_MONITOR_TCP, HEALTH_MONITOR_TLS_HELLO, HEALTH_MONITOR_UDP_CONNECT) health_monitor_http_method_get = 'GET' health_monitor_http_method_head = 'HEAD' health_monitor_http_method_post = 'POST' health_monitor_http_method_put = 'PUT' health_monitor_http_method_delete = 'DELETE' health_monitor_http_method_trace = 'TRACE' health_monitor_http_method_options = 'OPTIONS' health_monitor_http_method_connect = 'CONNECT' health_monitor_http_method_patch = 'PATCH' health_monitor_http_default_method = HEALTH_MONITOR_HTTP_METHOD_GET supported_health_monitor_http_methods = (HEALTH_MONITOR_HTTP_METHOD_GET, HEALTH_MONITOR_HTTP_METHOD_HEAD, HEALTH_MONITOR_HTTP_METHOD_POST, HEALTH_MONITOR_HTTP_METHOD_PUT, HEALTH_MONITOR_HTTP_METHOD_DELETE, HEALTH_MONITOR_HTTP_METHOD_TRACE, HEALTH_MONITOR_HTTP_METHOD_OPTIONS, HEALTH_MONITOR_HTTP_METHOD_CONNECT, HEALTH_MONITOR_HTTP_METHOD_PATCH) health_monitor_default_expected_codes = '200' health_monitor_default_url_path = '/' type = 'type' url_path = 'url_path' http_method = 'http_method' expected_codes = 'expected_codes' delay = 'delay' timeout = 'timeout' max_retries = 'max_retries' rise_threshold = 'rise_threshold' update_stats = 'UPDATE_STATS' update_health = 'UPDATE_HEALTH' protocol_tcp = 'TCP' protocol_udp = 'UDP' protocol_http = 'HTTP' protocol_https = 'HTTPS' protocol_terminated_https = 'TERMINATED_HTTPS' protocol_proxy = 'PROXY' supported_protocols = (PROTOCOL_TCP, PROTOCOL_HTTPS, PROTOCOL_HTTP, PROTOCOL_TERMINATED_HTTPS, PROTOCOL_PROXY, PROTOCOL_UDP) valid_listener_pool_protocol_map = {PROTOCOL_TCP: [PROTOCOL_HTTP, PROTOCOL_HTTPS, PROTOCOL_PROXY, PROTOCOL_TCP], PROTOCOL_HTTP: [PROTOCOL_HTTP, PROTOCOL_PROXY], PROTOCOL_HTTPS: [PROTOCOL_HTTPS, PROTOCOL_PROXY, PROTOCOL_TCP], PROTOCOL_TERMINATED_HTTPS: [PROTOCOL_HTTP, PROTOCOL_PROXY], PROTOCOL_UDP: [PROTOCOL_UDP]} min_port_number = 1 max_port_number = 65535 default_connection_limit = -1 min_connection_limit = -1 default_weight = 1 min_weight = 0 max_weight = 256 min_hm_retries = 1 max_hm_retries = 10 max_timeout = 365 * 24 * 60 * 60 * 1000 min_timeout = 0 default_timeout_client_data = 50000 default_timeout_member_connect = 5000 default_timeout_member_data = 50000 default_timeout_tcp_inspect = 0 amphora_allocated = 'ALLOCATED' amphora_booting = 'BOOTING' amphora_ready = 'READY' active = 'ACTIVE' pending_delete = 'PENDING_DELETE' pending_update = 'PENDING_UPDATE' pending_create = 'PENDING_CREATE' deleted = 'DELETED' error = 'ERROR' supported_provisioning_statuses = (ACTIVE, AMPHORA_ALLOCATED, AMPHORA_BOOTING, AMPHORA_READY, PENDING_DELETE, PENDING_CREATE, PENDING_UPDATE, DELETED, ERROR) mutable_statuses = (ACTIVE,) deletable_statuses = (ACTIVE, ERROR) failoverable_statuses = (ACTIVE, ERROR) supported_amphora_statuses = (AMPHORA_ALLOCATED, AMPHORA_BOOTING, ERROR, AMPHORA_READY, DELETED, PENDING_CREATE, PENDING_DELETE) online = 'ONLINE' offline = 'OFFLINE' degraded = 'DEGRADED' error = 'ERROR' draining = 'DRAINING' no_monitor = 'NO_MONITOR' operating_status = 'operating_status' provisioning_status = 'provisioning_status' supported_operating_statuses = (ONLINE, OFFLINE, DEGRADED, ERROR, DRAINING, NO_MONITOR) amphora_vm = 'VM' supported_amphora_types = (AMPHORA_VM,) l7_rule_type_host_name = 'HOST_NAME' l7_rule_type_path = 'PATH' l7_rule_type_file_type = 'FILE_TYPE' l7_rule_type_header = 'HEADER' l7_rule_type_cookie = 'COOKIE' supported_l7_rule_types = (L7RULE_TYPE_HOST_NAME, L7RULE_TYPE_PATH, L7RULE_TYPE_FILE_TYPE, L7RULE_TYPE_HEADER, L7RULE_TYPE_COOKIE) l7_rule_compare_type_regex = 'REGEX' l7_rule_compare_type_starts_with = 'STARTS_WITH' l7_rule_compare_type_ends_with = 'ENDS_WITH' l7_rule_compare_type_contains = 'CONTAINS' l7_rule_compare_type_equal_to = 'EQUAL_TO' supported_l7_rule_compare_types = (L7RULE_COMPARE_TYPE_REGEX, L7RULE_COMPARE_TYPE_STARTS_WITH, L7RULE_COMPARE_TYPE_ENDS_WITH, L7RULE_COMPARE_TYPE_CONTAINS, L7RULE_COMPARE_TYPE_EQUAL_TO) l7_policy_action_reject = 'REJECT' l7_policy_action_redirect_to_url = 'REDIRECT_TO_URL' l7_policy_action_redirect_to_pool = 'REDIRECT_TO_POOL' supported_l7_policy_actions = (L7POLICY_ACTION_REJECT, L7POLICY_ACTION_REDIRECT_TO_URL, L7POLICY_ACTION_REDIRECT_TO_POOL) min_policy_position = 1 max_policy_position = 2147483647 max_l7_rules_per_l7_policy = 50 http_header_name_regex = "\\A[a-zA-Z0-9!#$%&\\'*+-.^_`|~]+\\Z" http_cookie_value_regex = "\\A[a-zA-Z0-9!#$%&\\'()*+-./:<=>?@[\\]^_`{|}~]+\\Z" http_header_value_regex = '\\A[a-zA-Z0-9!"#$%&\\\'()*+,-./:;<=>?@[\\]^_`{|}~\\\\]+\\Z' http_quoted_header_value_regex = '\\A"[a-zA-Z0-9 \\t!"#$%&\\\'()*+,-./:;<=>?@[\\]^_`{|}~\\\\]*"\\Z' amphora = 'amphora' failed_amphora = 'failed_amphora' failover_amphora = 'failover_amphora' amphorae = 'amphorae' amphora_id = 'amphora_id' amphora_index = 'amphora_index' failover_amphora_id = 'failover_amphora_id' delta = 'delta' deltas = 'deltas' health_mon = 'health_mon' health_monitor = 'health_monitor' listener = 'listener' listeners = 'listeners' listener_id = 'listener_id' loadbalancer = 'loadbalancer' loadbalancers = 'loadbalancers' loadbalancer_id = 'loadbalancer_id' load_balancer_id = 'load_balancer_id' server_group_id = 'server_group_id' anti_affinity = 'anti-affinity' soft_anti_affinity = 'soft-anti-affinity' member = 'member' members = 'members' member_id = 'member_id' compute_id = 'compute_id' compute_obj = 'compute_obj' amp_data = 'amp_data' amps_data = 'amps_data' nics = 'nics' vip = 'vip' pool = 'pool' pools = 'pools' pool_child_count = 'pool_child_count' pool_id = 'pool_id' l7_policy = 'l7policy' l7_rule = 'l7rule' object = 'object' server_pem = 'server_pem' update_dict = 'update_dict' vip_network = 'vip_network' amphorae_network_config = 'amphorae_network_config' added_ports = 'added_ports' ports = 'ports' member_ports = 'member_ports' loadbalancer_topology = 'topology' healthmonitors = 'healthmonitors' health_monitor_id = 'health_monitor_id' l7_policies = 'l7policies' l7_policy_id = 'l7policy_id' l7_rules = 'l7rules' l7_rule_id = 'l7rule_id' load_balancer_updates = 'load_balancer_updates' listener_updates = 'listener_updates' pool_updates = 'pool_updates' member_updates = 'member_updates' health_monitor_updates = 'health_monitor_updates' l7_policy_updates = 'l7policy_updates' l7_rule_updates = 'l7rule_updates' timeout_dict = 'timeout_dict' req_conn_timeout = 'req_conn_timeout' req_read_timeout = 'req_read_timeout' conn_max_retries = 'conn_max_retries' conn_retry_interval = 'conn_retry_interval' cert_rotate_amphora_flow = 'octavia-cert-rotate-amphora-flow' create_amphora_flow = 'octavia-create-amphora-flow' create_amphora_for_lb_flow = 'octavia-create-amp-for-lb-flow' create_health_monitor_flow = 'octavia-create-health-monitor-flow' create_listener_flow = 'octavia-create-listener_flow' pre_create_loadbalancer_flow = 'octavia-pre-create-loadbalancer-flow' create_server_group_flow = 'octavia-create-server-group-flow' update_lb_servergroupid_flow = 'octavia-update-lb-server-group-id-flow' create_listeners_flow = 'octavia-create-all-listeners-flow' create_loadbalancer_flow = 'octavia-create-loadbalancer-flow' create_loadbalancer_graph_flow = 'octavia-create-loadbalancer-graph-flow' create_member_flow = 'octavia-create-member-flow' create_pool_flow = 'octavia-create-pool-flow' create_l7_policy_flow = 'octavia-create-l7policy-flow' create_l7_rule_flow = 'octavia-create-l7rule-flow' delete_amphora_flow = 'octavia-delete-amphora-flow' delete_health_monitor_flow = 'octavia-delete-health-monitor-flow' delete_listener_flow = 'octavia-delete-listener_flow' delete_loadbalancer_flow = 'octavia-delete-loadbalancer-flow' delete_member_flow = 'octavia-delete-member-flow' delete_pool_flow = 'octavia-delete-pool-flow' delete_l7_policy_flow = 'octavia-delete-l7policy-flow' delete_l7_rule_flow = 'octavia-delete-l7policy-flow' failover_amphora_flow = 'octavia-failover-amphora-flow' loadbalancer_networking_subflow = 'octavia-new-loadbalancer-net-subflow' update_health_monitor_flow = 'octavia-update-health-monitor-flow' update_listener_flow = 'octavia-update-listener-flow' update_loadbalancer_flow = 'octavia-update-loadbalancer-flow' update_member_flow = 'octavia-update-member-flow' update_pool_flow = 'octavia-update-pool-flow' update_l7_policy_flow = 'octavia-update-l7policy-flow' update_l7_rule_flow = 'octavia-update-l7rule-flow' update_amps_subflow = 'octavia-update-amps-subflow' post_map_amp_to_lb_subflow = 'octavia-post-map-amp-to-lb-subflow' create_amp_for_lb_subflow = 'octavia-create-amp-for-lb-subflow' get_amphora_for_lb_subflow = 'octavia-get-amphora-for-lb-subflow' post_lb_amp_association_subflow = 'octavia-post-loadbalancer-amp_association-subflow' map_loadbalancer_to_amphora = 'octavia-mapload-balancer-to-amphora' reload_amphora = 'octavia-reload-amphora' create_amphora_indb = 'octavia-create-amphora-indb' generate_server_pem = 'octavia-generate-serverpem' update_cert_expiration = 'octavia-update-cert-expiration' cert_compute_create = 'octavia-cert-compute-create' compute_create = 'octavia-compute-create' update_amphora_computeid = 'octavia-update-amphora-computeid' mark_amphora_booting_indb = 'octavia-mark-amphora-booting-indb' wait_for_amphora = 'octavia-wait_for_amphora' compute_wait = 'octavia-compute-wait' update_amphora_info = 'octavia-update-amphora-info' amphora_finalize = 'octavia-amphora-finalize' mark_amphora_allocated_indb = 'octavia-mark-amphora-allocated-indb' reloadload_balancer = 'octavia-reloadload-balancer' mark_lb_active_indb = 'octavia-mark-lb-active-indb' mark_amp_master_indb = 'octavia-mark-amp-master-indb' mark_amp_backup_indb = 'octavia-mark-amp-backup-indb' mark_amp_standalone_indb = 'octavia-mark-amp-standalone-indb' get_vrrp_subflow = 'octavia-get-vrrp-subflow' amp_vrrp_update = 'octavia-amphora-vrrp-update' amp_vrrp_start = 'octavia-amphora-vrrp-start' amp_vrrp_stop = 'octavia-amphora-vrrp-stop' amp_update_vrrp_intf = 'octavia-amphora-update-vrrp-intf' create_vrrp_group_for_lb = 'octavia-create-vrrp-group-for-lb' create_vrrp_security_rules = 'octavia-create-vrrp-security-rules' amp_compute_connectivity_wait = 'octavia-amp-compute-connectivity-wait' amp_listener_update = 'octavia-amp-listeners-update' generate_server_pem_task = 'GenerateServerPEMTask' members = 'members' unordered_member_updates_flow = 'octavia-unordered-member-updates-flow' unordered_member_active_flow = 'octavia-unordered-member-active-flow' update_attributes_flow = 'octavia-update-attributes-flow' delete_model_object_flow = 'octavia-delete-model-object-flow' batch_update_members_flow = 'octavia-batch-update-members-flow' member_to_error_on_revert_flow = 'octavia-member-to-error-on-revert-flow' decrement_member_quota_flow = 'octavia-decrement-member-quota-flow' mark_member_active_indb = 'octavia-mark-member-active-indb' update_member_indb = 'octavia-update-member-indb' delete_member_indb = 'octavia-delete-member-indb' reload_lb_after_amp_assoc = 'reload-lb-after-amp-assoc' reload_lb_after_amp_assoc_full_graph = 'reload-lb-after-amp-assoc-full-graph' reload_lb_after_plug_vip = 'reload-lb-after-plug-vip' nova_1 = '1.1' nova_21 = '2.1' nova_3 = '3' nova_versions = (NOVA_1, NOVA_21, NOVA_3) service_auth = 'service_auth' rpc_namespace_controller_agent = 'controller' lb_create_failover_priority = 20 lb_create_normal_priority = 40 lb_create_spares_pool_priority = 60 lb_create_admin_failover_priority = 80 build_type_priority = 'build_type_priority' topology_single = 'SINGLE' topology_active_standby = 'ACTIVE_STANDBY' role_master = 'MASTER' role_backup = 'BACKUP' role_standalone = 'STANDALONE' supported_lb_topologies = (TOPOLOGY_ACTIVE_STANDBY, TOPOLOGY_SINGLE) supported_amphora_roles = (ROLE_BACKUP, ROLE_MASTER, ROLE_STANDALONE) topology_status_ok = 'OK' role_master_priority = 100 role_backup_priority = 90 vrrp_auth_default = 'PASS' vrrp_auth_ah = 'AH' supported_vrrp_auth = (VRRP_AUTH_DEFAULT, VRRP_AUTH_AH) keepalived_cmd = '/usr/sbin/keepalived ' default_vrrp_id = 1 vrrp_protocol_num = 112 auth_header_protocol_number = 51 templates = '/templates' agent_api_templates = '/templates' agent_conf_template = 'amphora_agent_conf.template' user_data_config_drive_template = 'user_data_config_drive.template' open = 'OPEN' full = 'FULL' haproxy_listener_statuses = (OPEN, FULL) up = 'UP' down = 'DOWN' haproxy_backend_statuses = (UP, DOWN) drain = 'DRAIN' maint = 'MAINT' no_check = 'no check' haproxy_member_statuses = (UP, DOWN, DRAIN, MAINT, NO_CHECK) haproxy_max_maxconn = 1000000 quota_unlimited = -1 min_quota = QUOTA_UNLIMITED max_quota = 2000000000 api_version = '0.5' noop_event_streamer = 'noop_event_streamer' haproxy_base_peer_port = 1025 keepalived_jinja2_upstart = 'keepalived.upstart.j2' keepalived_jinja2_systemd = 'keepalived.systemd.j2' keepalived_jinja2_sysvinit = 'keepalived.sysvinit.j2' check_script_conf = 'keepalived_check_script.conf.j2' keepalived_check_script = 'keepalived_lvs_check_script.sh.j2' plugged_interfaces = '/var/lib/octavia/plugged_interfaces' haproxy_user_group_cfg = '/var/lib/octavia/haproxy-default-user-group.conf' amphora_namespace = 'amphora-haproxy' supported_http_headers = ['X-Forwarded-For', 'X-Forwarded-Port', 'X-Forwarded-Proto'] flow_doc_titles = {'AmphoraFlows': 'Amphora Flows', 'LoadBalancerFlows': 'Load Balancer Flows', 'ListenerFlows': 'Listener Flows', 'PoolFlows': 'Pool Flows', 'MemberFlows': 'Member Flows', 'HealthMonitorFlows': 'Health Monitor Flows', 'L7PolicyFlows': 'Layer 7 Policy Flows', 'L7RuleFlows': 'Layer 7 Rule Flows'} netns_primary_interface = 'eth1' sysctl_cmd = '/sbin/sysctl' amp_action_start = 'start' amp_action_stop = 'stop' amp_action_reload = 'reload' amp_action_restart = 'restart' glance_image_active = 'active' init_systemd = 'systemd' init_upstart = 'upstart' init_sysvinit = 'sysvinit' init_unkown = 'unknown' valid_init_systems = (INIT_SYSTEMD, INIT_SYSVINIT, INIT_UPSTART) init_path = '/sbin/init' systemd_dir = '/usr/lib/systemd/system' sysvinit_dir = '/etc/init.d' upstart_dir = '/etc/init' init_proc_comm_path = '/proc/1/comm' keepalived_systemd = 'octavia-keepalived.service' keepalived_sysvinit = 'octavia-keepalived' keepalived_upstart = 'octavia-keepalived.conf' keepalived_systemd_prefix = 'octavia-keepalivedlvs-%s.service' keepalived_sysvinit_prefix = 'octavia-keepalivedlvs-%s' keepalived_upstart_prefix = 'octavia-keepalivedlvs-%s.conf' keystone = 'keystone' noauth = 'noauth' testing = 'testing' ubuntu_amp_net_dir_template = '/etc/netns/{netns}/network/interfaces.d/' rh_amp_net_dir_template = '/etc/netns/{netns}/sysconfig/network-scripts/' ubuntu = 'ubuntu' centos = 'centos' application_json = 'application/json' pagination_helper = 'pagination_helper' asc = 'asc' desc = 'desc' allowed_sort_dir = (ASC, DESC) default_sort_dir = ASC default_sort_keys = ['created_at', 'id'] default_page_size = 1000 loadbalancer_api = 'os_load-balancer_api' rule_api_admin = 'rule:load-balancer:admin' rule_api_read = 'rule:load-balancer:read' rule_api_read_global = 'rule:load-balancer:read-global' rule_api_write = 'rule:load-balancer:write' rule_api_read_quota = 'rule:load-balancer:read-quota' rule_api_read_quota_global = 'rule:load-balancer:read-quota-global' rule_api_write_quota = 'rule:load-balancer:write-quota' rbac_loadbalancer = '{}:loadbalancer:'.format(LOADBALANCER_API) rbac_listener = '{}:listener:'.format(LOADBALANCER_API) rbac_pool = '{}:pool:'.format(LOADBALANCER_API) rbac_member = '{}:member:'.format(LOADBALANCER_API) rbac_healthmonitor = '{}:healthmonitor:'.format(LOADBALANCER_API) rbac_l7_policy = '{}:l7policy:'.format(LOADBALANCER_API) rbac_l7_rule = '{}:l7rule:'.format(LOADBALANCER_API) rbac_quota = '{}:quota:'.format(LOADBALANCER_API) rbac_amphora = '{}:amphora:'.format(LOADBALANCER_API) rbac_provider = '{}:provider:'.format(LOADBALANCER_API) rbac_post = 'post' rbac_put = 'put' rbac_put_failover = 'put_failover' rbac_delete = 'delete' rbac_get_one = 'get_one' rbac_get_all = 'get_all' rbac_get_all_global = 'get_all-global' rbac_get_defaults = 'get_defaults' rbac_get_stats = 'get_stats' rbac_get_status = 'get_status' octavia = 'octavia' supported_flavors = () disable = 'disable' enable = 'enable' amp_netns_svc_prefix = 'amphora-netns'
class Parent: def __getitem__(self, idx): return 0 class Child(Parent): def index_super(self, idx): return super()[idx] kid = Child() print(f'kid[0]: {kid[0]}') print(f'kid.index_super(0): {kid.index_super(0)}')
class Parent: def __getitem__(self, idx): return 0 class Child(Parent): def index_super(self, idx): return super()[idx] kid = child() print(f'kid[0]: {kid[0]}') print(f'kid.index_super(0): {kid.index_super(0)}')
def run_training_loop(): dataset_reader = build_dataset_reader() # These are a subclass of pytorch Datasets, with some allennlp-specific # functionality added. train_data, dev_data = read_data(dataset_reader) vocab = build_vocab(train_data + dev_data) model = build_model(vocab) # This is the allennlp-specific functionality in the Dataset object; # we need to be able convert strings in the data to integers, and this # is how we do it. train_data.index_with(vocab) dev_data.index_with(vocab) # These are again a subclass of pytorch DataLoaders, with an # allennlp-specific collate function, that runs our indexing and # batching code. train_loader, dev_loader = build_data_loaders(train_data, dev_data) # You obviously won't want to create a temporary file for your training # results, but for execution in binder for this guide, we need to do this. with tempfile.TemporaryDirectory() as serialization_dir: trainer = build_trainer( model, serialization_dir, train_loader, dev_loader ) print("Starting training") trainer.train() print("Finished training") # The other `build_*` methods are things we've seen before, so they are # in the setup section above. def build_data_loaders( train_data: torch.utils.data.Dataset, dev_data: torch.utils.data.Dataset, ) -> Tuple[allennlp.data.DataLoader, allennlp.data.DataLoader]: # Note that DataLoader is imported from allennlp above, *not* torch. # We need to get the allennlp-specific collate function, which is # what actually does indexing and batching. train_loader = DataLoader(train_data, batch_size=8, shuffle=True) dev_loader = DataLoader(dev_data, batch_size=8, shuffle=False) return train_loader, dev_loader def build_trainer( model: Model, serialization_dir: str, train_loader: DataLoader, dev_loader: DataLoader ) -> Trainer: parameters = [ [n, p] for n, p in model.named_parameters() if p.requires_grad ] optimizer = AdamOptimizer(parameters) trainer = GradientDescentTrainer( model=model, serialization_dir=serialization_dir, data_loader=train_loader, validation_data_loader=dev_loader, num_epochs=5, optimizer=optimizer, ) return trainer run_training_loop()
def run_training_loop(): dataset_reader = build_dataset_reader() (train_data, dev_data) = read_data(dataset_reader) vocab = build_vocab(train_data + dev_data) model = build_model(vocab) train_data.index_with(vocab) dev_data.index_with(vocab) (train_loader, dev_loader) = build_data_loaders(train_data, dev_data) with tempfile.TemporaryDirectory() as serialization_dir: trainer = build_trainer(model, serialization_dir, train_loader, dev_loader) print('Starting training') trainer.train() print('Finished training') def build_data_loaders(train_data: torch.utils.data.Dataset, dev_data: torch.utils.data.Dataset) -> Tuple[allennlp.data.DataLoader, allennlp.data.DataLoader]: train_loader = data_loader(train_data, batch_size=8, shuffle=True) dev_loader = data_loader(dev_data, batch_size=8, shuffle=False) return (train_loader, dev_loader) def build_trainer(model: Model, serialization_dir: str, train_loader: DataLoader, dev_loader: DataLoader) -> Trainer: parameters = [[n, p] for (n, p) in model.named_parameters() if p.requires_grad] optimizer = adam_optimizer(parameters) trainer = gradient_descent_trainer(model=model, serialization_dir=serialization_dir, data_loader=train_loader, validation_data_loader=dev_loader, num_epochs=5, optimizer=optimizer) return trainer run_training_loop()
class Solution: def peakIndexInMountainArray(self, arr): for i in range(1, len(arr)-1): if arr[i-1] < arr[i] > arr[i+1]: return i """ Success Details Runtime: 76 ms, faster than 62.35% of Python3 online submissions for Peak Index in a Mountain Array. Memory Usage: 15.4 MB, less than 12.58% of Python3 online submissions for Peak Index in a Mountain Array. Next challenges: Find in Mountain Array """
class Solution: def peak_index_in_mountain_array(self, arr): for i in range(1, len(arr) - 1): if arr[i - 1] < arr[i] > arr[i + 1]: return i '\nSuccess\nDetails \nRuntime: 76 ms, faster than 62.35% of Python3 online submissions for Peak Index in a Mountain Array.\nMemory Usage: 15.4 MB, less than 12.58% of Python3 online submissions for Peak Index in a Mountain Array.\nNext challenges:\nFind in Mountain Array\n'
n, m = [int(tmp) for tmp in input().split()] dic = {} for cnt in range(n): k, v = [tmp for tmp in input().split()] dic[k] = v words = input().split() for word in words: if word in dic: print(dic[word], end=' kachal! ') else: print(end='kachal! ')
(n, m) = [int(tmp) for tmp in input().split()] dic = {} for cnt in range(n): (k, v) = [tmp for tmp in input().split()] dic[k] = v words = input().split() for word in words: if word in dic: print(dic[word], end=' kachal! ') else: print(end='kachal! ')
def is_superset(A, B, count): if A == B or len(A) < len(B): count = count elif A.issuperset(B): count = count + 1 return count if __name__ == "__main__": A = set(map(int, input().split())) # Set A elements n = int(input()) # no. of other sets count = 0 for i in range(n): set_B = set(map(int, input().split())) count = is_superset(A, set_B, count) if count == n: print(True, end="") else: print(False, end="") # Input # 1 2 3 4 5 6 7 8 9 10 11 12 23 45 84 78 # 2 # 1 2 3 4 5 # 100 11 12 # Output # False # Strict superset # Set([1,3,4]) is a strict superset of set([1,3]). # Set([1,3,4]) is not a strict superset of set([1,3,4]). # Set([1,3,4]) is not a strict superset of set([1,3,5]).
def is_superset(A, B, count): if A == B or len(A) < len(B): count = count elif A.issuperset(B): count = count + 1 return count if __name__ == '__main__': a = set(map(int, input().split())) n = int(input()) count = 0 for i in range(n): set_b = set(map(int, input().split())) count = is_superset(A, set_B, count) if count == n: print(True, end='') else: print(False, end='')
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- def go() : return {"id":10, "sequence":"chen"} def go2(a,b,c): return str({"id":b, "sequence":"chen"}) print('chen')
def go(): return {'id': 10, 'sequence': 'chen'} def go2(a, b, c): return str({'id': b, 'sequence': 'chen'}) print('chen')
# Starting values (of global variables) def get_response(text): print("") print(text) selection = input() return selection class CoffeeMachine: def __init__(self, w, m, b, c, dollars): self.water = w self.milk = m self.beans = b self.cups = c self.money = dollars def remaining(self): print("") print("The coffee machine has:") print(str(self.water) + " of water") print(str(self.milk) + " of milk") print(str(self.beans) + " of coffee beans") print(str(self.cups) + " of disposable cups") print("$" + str(self.money) + " of money") def enough(self, w, m, b, c): # checks if there is enough stock for sale if self.water - w < 0: return "water" elif self.milk - m < 0: return "milk" elif self.beans - b < 0: return "beans" elif self.cups - c < 0: return "cups" else: return "ok" def buy(self): coffee_type = get_response("What do you want to buy? 1 - espresso, 2 - latte, 3 - cappuccino: ") if coffee_type == "1": # Espresso: resource = self.enough(250, 0, 16, 1) if resource == "ok": self.water -= 250 self.milk -= 0 self.beans -= 16 self.cups -= 1 self.money += 4 print("I have enough resources, making you a coffee!") else: print("Sorry, not enough " + resource + "!") elif coffee_type == "2": # Latte: resource = self.enough(350, 75, 20, 1) if resource == "ok": self.water -= 350 self.milk -= 75 self.beans -= 20 self.cups -= 1 self.money += 7 print("I have enough resources, making you a coffee!") else: print("Sorry, not enough " + resource + "!") elif coffee_type == "3": # Cappuccino: resource = self.enough(200, 100, 12, 1) if resource == "ok": self.water -= 200 self.milk -= 100 self.beans -= 12 self.cups -= 1 self.money += 6 print("I have enough resources, making you a coffee!") else: print("Sorry, not enough " + resource + "!") def fill(self): self.water += int(get_response("Write how many ml of water do you want to add: ")) self.milk += int(get_response("Write how many ml of milk do you want to add: ")) self.beans += int(get_response("Write how many grams of coffee beans do you want to add: ")) self.cups += int(get_response("Write how many disposable cups of coffee do you want to add: ")) def take(self): print("I gave you $" + str(self.money)) self.money = 0 # Main programs command = "" machine = CoffeeMachine(400, 540, 120, 9, 550) while command != "exit": command = get_response("Write action (buy, fill, take, remaining, exit): ") if command == "buy": machine.buy() elif command == "fill": machine.fill() elif command == "take": machine.take() elif command == "remaining": machine.remaining()
def get_response(text): print('') print(text) selection = input() return selection class Coffeemachine: def __init__(self, w, m, b, c, dollars): self.water = w self.milk = m self.beans = b self.cups = c self.money = dollars def remaining(self): print('') print('The coffee machine has:') print(str(self.water) + ' of water') print(str(self.milk) + ' of milk') print(str(self.beans) + ' of coffee beans') print(str(self.cups) + ' of disposable cups') print('$' + str(self.money) + ' of money') def enough(self, w, m, b, c): if self.water - w < 0: return 'water' elif self.milk - m < 0: return 'milk' elif self.beans - b < 0: return 'beans' elif self.cups - c < 0: return 'cups' else: return 'ok' def buy(self): coffee_type = get_response('What do you want to buy? 1 - espresso, 2 - latte, 3 - cappuccino: ') if coffee_type == '1': resource = self.enough(250, 0, 16, 1) if resource == 'ok': self.water -= 250 self.milk -= 0 self.beans -= 16 self.cups -= 1 self.money += 4 print('I have enough resources, making you a coffee!') else: print('Sorry, not enough ' + resource + '!') elif coffee_type == '2': resource = self.enough(350, 75, 20, 1) if resource == 'ok': self.water -= 350 self.milk -= 75 self.beans -= 20 self.cups -= 1 self.money += 7 print('I have enough resources, making you a coffee!') else: print('Sorry, not enough ' + resource + '!') elif coffee_type == '3': resource = self.enough(200, 100, 12, 1) if resource == 'ok': self.water -= 200 self.milk -= 100 self.beans -= 12 self.cups -= 1 self.money += 6 print('I have enough resources, making you a coffee!') else: print('Sorry, not enough ' + resource + '!') def fill(self): self.water += int(get_response('Write how many ml of water do you want to add: ')) self.milk += int(get_response('Write how many ml of milk do you want to add: ')) self.beans += int(get_response('Write how many grams of coffee beans do you want to add: ')) self.cups += int(get_response('Write how many disposable cups of coffee do you want to add: ')) def take(self): print('I gave you $' + str(self.money)) self.money = 0 command = '' machine = coffee_machine(400, 540, 120, 9, 550) while command != 'exit': command = get_response('Write action (buy, fill, take, remaining, exit): ') if command == 'buy': machine.buy() elif command == 'fill': machine.fill() elif command == 'take': machine.take() elif command == 'remaining': machine.remaining()
def encryptRailFence(text, key): rail = [['\n' for i in range(len(text))] for j in range(key)] dir_down = False row, col = 0, 0 for i in range(len(text)): if (row == 0) or (row == key - 1): dir_down = not dir_down rail[row][col] = text[i] col += 1 if dir_down: row += 1 else: row -= 1 result = [] for i in range(key): for j in range(len(text)): if rail[i][j] != '\n': result.append(rail[i][j]) return("" . join(result)) def decryptRailFence(cipher, key): rail = [['\n' for i in range(len(cipher))] for j in range(key)] dir_down = None row, col = 0, 0 for i in range(len(cipher)): if row == 0: dir_down = True if row == key - 1: dir_down = False rail[row][col] = '*' col += 1 if dir_down: row += 1 else: row -= 1 index = 0 for i in range(key): for j in range(len(cipher)): if ((rail[i][j] == '*') and (index < len(cipher))): rail[i][j] = cipher[index] index += 1 result = [] row, col = 0, 0 for i in range(len(cipher)): # check the direction of flow if row == 0: dir_down = True if row == key-1: dir_down = False if (rail[row][col] != '*'): result.append(rail[row][col]) col += 1 if dir_down: row += 1 else: row -= 1 return("".join(result)) if __name__ == "__main__": s=input("Enter the text:") n=int(input("Key:")) str=encryptRailFence(s, n) print(f"Encrypted Text:{str}") print(f"Decrypted Text:{decryptRailFence(str, n)}")
def encrypt_rail_fence(text, key): rail = [['\n' for i in range(len(text))] for j in range(key)] dir_down = False (row, col) = (0, 0) for i in range(len(text)): if row == 0 or row == key - 1: dir_down = not dir_down rail[row][col] = text[i] col += 1 if dir_down: row += 1 else: row -= 1 result = [] for i in range(key): for j in range(len(text)): if rail[i][j] != '\n': result.append(rail[i][j]) return ''.join(result) def decrypt_rail_fence(cipher, key): rail = [['\n' for i in range(len(cipher))] for j in range(key)] dir_down = None (row, col) = (0, 0) for i in range(len(cipher)): if row == 0: dir_down = True if row == key - 1: dir_down = False rail[row][col] = '*' col += 1 if dir_down: row += 1 else: row -= 1 index = 0 for i in range(key): for j in range(len(cipher)): if rail[i][j] == '*' and index < len(cipher): rail[i][j] = cipher[index] index += 1 result = [] (row, col) = (0, 0) for i in range(len(cipher)): if row == 0: dir_down = True if row == key - 1: dir_down = False if rail[row][col] != '*': result.append(rail[row][col]) col += 1 if dir_down: row += 1 else: row -= 1 return ''.join(result) if __name__ == '__main__': s = input('Enter the text:') n = int(input('Key:')) str = encrypt_rail_fence(s, n) print(f'Encrypted Text:{str}') print(f'Decrypted Text:{decrypt_rail_fence(str, n)}')
array_a = [1, 2, 3, 5] array_b = [4, 6, 7, 8] def merge(array1, array2): idx_a = 0 idx_b = 0 len_a = len(array1) len_b = len(array2) res = [] while True: if array1[idx_a] > array2[idx_b]: res.append(array2[idx_b]) idx_b += 1 else: res.append(array1[idx_a]) idx_a += 1 if idx_a == len_a -1 or idx_b == len_b - 1: break if idx_b == len_b - 1: return res + array1[idx_a:] else: return res + array2[idx_b:] print(merge(array_a, array_b))
array_a = [1, 2, 3, 5] array_b = [4, 6, 7, 8] def merge(array1, array2): idx_a = 0 idx_b = 0 len_a = len(array1) len_b = len(array2) res = [] while True: if array1[idx_a] > array2[idx_b]: res.append(array2[idx_b]) idx_b += 1 else: res.append(array1[idx_a]) idx_a += 1 if idx_a == len_a - 1 or idx_b == len_b - 1: break if idx_b == len_b - 1: return res + array1[idx_a:] else: return res + array2[idx_b:] print(merge(array_a, array_b))
class Scenario: def __init__(self, start, end, mmap, dvmap, tc_id: int, park=None, side=0): self.start = start self.end = end self.map = mmap self.ID = str(tc_id) self.park = park self.dvmap = dvmap self.side = side def __str__(self): return str(self.__class__) + ": " + str(self.__dict__)
class Scenario: def __init__(self, start, end, mmap, dvmap, tc_id: int, park=None, side=0): self.start = start self.end = end self.map = mmap self.ID = str(tc_id) self.park = park self.dvmap = dvmap self.side = side def __str__(self): return str(self.__class__) + ': ' + str(self.__dict__)
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # def message(e): # type: (Exception) -> str """ Gets the 'message' from an exception """ # If we want the message, check if it exists # Supports Python2 # # For python 3 call str will grab the message if hasattr(e, 'message'): return e.message else: return str(e)
def message(e): """ Gets the 'message' from an exception """ if hasattr(e, 'message'): return e.message else: return str(e)
# Loops # Loops are repeating segments of code, and come in two types, while and for. Lets start with a "for" loop. # "for" loops can be expressed in the following manner: for i in range(0, 9): print(i) # For loops work by repeating until the loop has executed a specific number of times, or until all values in a data # structure have been accessed. We will touch more on using for loops with data structures later in this lesson. But # first, lets dissect what this code segment is doing. # We first see the characters "for", which indicate to the computer that the following code will be a for loop. # The next part of the code is known as the "iterable", and in this example, every time the code is run it will be # increased in value by one. # Following the iterable, we see what looks like a function, and it is! Don't worry about what it is too much, all # you need to know right now is that it sets the range for this function, meaning that it sets the starting value, and # the value at which the for loop will terminate at. This value is stored in the iterable "i". In the above example, the # loop will stop when i reaches the value of 9, not before or after, but exactly on. This is checked at the start of # each loop execution ("iteration"). # What follows the semicolon is what action the for loop will perform, in this case, it will simply print the current # value of i. This value will increase with each iteration of the loop. i is increased by one at the end of each # iteration. # If you have a keen eye, you may have noticed that the loop only goes from zero to eight! You may think this is a # bug, as (0, 9) is clearly specified as the range for the function, but you must remember lesson zero and how loops # work. The value starts at zero, which is printed to console, and terminates at 9, which is checked at the beginning # of each iteration. This means that nine would never be printed, as nine is the number at which the loop terminates at. # If you count how many numbers are printed to console, you'll also notice nine numbers are there, since you began # counting at zero. exampleList = [ "This", "Is", "a", "Demonstration" ] for i in exampleList: print(i) # In this loop, you'll see we have dropped range() in favor of a list! This means that the loop will execute until # every value in the loop becomes "i". Since we are calling print() for each value, all of the strings stored inside # the list will be printed to console. You can do many advanced things with this, as you will soon learn. # While loops condition = True while condition: print("Success") condition = False # While loops are a form of conditional statement, and will only run while the condition being checked against is # True (by default), or anything you change it to. Many of the ways to interact with standard conditional statements # also apply to while loops. condition = False while not condition: print("Success") condition = True # And of course, strings work too! exampleString = "rain" while exampleString == "rain": print("Success") exampleString = "water" # While loops are important, because they have no definite end. You may need to execute one block of code until a # certain condition is met, for example, in web scraping, you may check a website until you find a certain block # of text. You may also want to use while loops in user interfaces to continually ask questions, or to keep a certain # block of code running in order to continually execute your program. # To finish this lesson, try out both kinds of loops for yourself! Feel free to ask any questions.
for i in range(0, 9): print(i) example_list = ['This', 'Is', 'a', 'Demonstration'] for i in exampleList: print(i) condition = True while condition: print('Success') condition = False condition = False while not condition: print('Success') condition = True example_string = 'rain' while exampleString == 'rain': print('Success') example_string = 'water'
# Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... # # You may assume the input array always has a valid answer. def wiggleSort(nums): nums.sort() mid = (len(nums) + 1) // 2 left, right = nums[:mid], nums[mid:] nums[::2] = left[::-1] nums[1::2] = right[::-1] nums = [1,3,2,2,3,1] wiggleSort(nums) print(nums)
def wiggle_sort(nums): nums.sort() mid = (len(nums) + 1) // 2 (left, right) = (nums[:mid], nums[mid:]) nums[::2] = left[::-1] nums[1::2] = right[::-1] nums = [1, 3, 2, 2, 3, 1] wiggle_sort(nums) print(nums)
""" File: weather_master.py Name: HJ ----------------------- This program should implement a console program that asks weather data from user to compute the average, highest, lowest, cold days among the inputs. Output format should match what is shown in the sample run in the Assignment 2 Handout. """ QUIT = -100 def main(): """ This program print the highest, lowest, and average temperature by computing the users inputs. """ print("standCode \"Weather Master 4.0") data = int(input('Next Temperature: (or '+str(QUIT)+' to quit)? ')) if data == QUIT: # filter the first input is QUIT print('No temperatures were entered.') else: high_temp = data low_temp = data total_temp = data days = 1 cold_days = 0 if data < 16: # whether the first input is below 16 degree cold_days += 1 while True: data = int(input('Next Temperature: (or ' + str(QUIT) + ' to quit)? ')) if data == QUIT: # leave the loop if QUIT number is entered break if data > high_temp: high_temp = data if data < low_temp: low_temp = data if data < 16: cold_days += 1 total_temp += data days += 1 print('Highest temperature = '+str(high_temp)) print('Lowest temperature = '+str(low_temp)) print('Average = '+str(total_temp/days)) print(str(cold_days)+' cold day(s)') ###### DO NOT EDIT CODE BELOW THIS LINE ###### if __name__ == "__main__": main()
""" File: weather_master.py Name: HJ ----------------------- This program should implement a console program that asks weather data from user to compute the average, highest, lowest, cold days among the inputs. Output format should match what is shown in the sample run in the Assignment 2 Handout. """ quit = -100 def main(): """ This program print the highest, lowest, and average temperature by computing the users inputs. """ print('standCode "Weather Master 4.0') data = int(input('Next Temperature: (or ' + str(QUIT) + ' to quit)? ')) if data == QUIT: print('No temperatures were entered.') else: high_temp = data low_temp = data total_temp = data days = 1 cold_days = 0 if data < 16: cold_days += 1 while True: data = int(input('Next Temperature: (or ' + str(QUIT) + ' to quit)? ')) if data == QUIT: break if data > high_temp: high_temp = data if data < low_temp: low_temp = data if data < 16: cold_days += 1 total_temp += data days += 1 print('Highest temperature = ' + str(high_temp)) print('Lowest temperature = ' + str(low_temp)) print('Average = ' + str(total_temp / days)) print(str(cold_days) + ' cold day(s)') if __name__ == '__main__': main()
""" LC 127 A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList. sk == endWord Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists. Example 1: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"] Output: 5 Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long. Example 2: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"] Output: 0 Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence. """ class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: if endWord not in wordList: return 0 wordList.append(beginWord) wordList = set(wordList) self.word_set = wordList level = deque([beginWord]) cnt = 1 while level: cnt += 1 for _ in range(len(level)): for c in self.n2c(level.popleft()): if c == endWord: return cnt level.append(c) return 0 def n2c(self, s1): for i in range(len(s1)): for k in map(chr, range(ord('a'), ord('z') + 1)): if k == s1[i]: continue s2 = s1[:i] + k + s1[i + 1:] if s2 not in self.word_set: continue self.word_set.remove(s2) yield s2 """ Time O(L^2 * N) Space O(LN) """
""" LC 127 A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 <= i <= k is in wordList. Note that beginWord does not need to be in wordList. sk == endWord Given two words, beginWord and endWord, and a dictionary wordList, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists. Example 1: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"] Output: 5 Explanation: One shortest transformation sequence is "hit" -> "hot" -> "dot" -> "dog" -> cog", which is 5 words long. Example 2: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"] Output: 0 Explanation: The endWord "cog" is not in wordList, therefore there is no valid transformation sequence. """ class Solution: def ladder_length(self, beginWord: str, endWord: str, wordList: List[str]) -> int: if endWord not in wordList: return 0 wordList.append(beginWord) word_list = set(wordList) self.word_set = wordList level = deque([beginWord]) cnt = 1 while level: cnt += 1 for _ in range(len(level)): for c in self.n2c(level.popleft()): if c == endWord: return cnt level.append(c) return 0 def n2c(self, s1): for i in range(len(s1)): for k in map(chr, range(ord('a'), ord('z') + 1)): if k == s1[i]: continue s2 = s1[:i] + k + s1[i + 1:] if s2 not in self.word_set: continue self.word_set.remove(s2) yield s2 '\nTime O(L^2 * N)\nSpace O(LN)\n'
l = [1,2,3,4,5] print(l) def mul_by2(num): return num*2 for result in map(mul_by2,l): print(result)
l = [1, 2, 3, 4, 5] print(l) def mul_by2(num): return num * 2 for result in map(mul_by2, l): print(result)
new_npc_stats = { 'base_stats': { 'vit': 4, 'dex': 4, 'str': 4, 'int': 4, 'agility': 8, 'toughness': 9, }, 'stats': { 'max_hp': 'from vit', # vit*hp_per_vit + lvl*hp_per_lvl 'max_mana': 'from int?', 'armor': 'from str and toughness', 'magic_resistance': 'from toughness', # and int? 'speed': 'from dex and agility', 'dodge': 'from dex and speed', 'crit_chance': 'from dex', 'crit_dmg': 'from dex', }, 'storage': { 'equipped items': 'armor, weapons, ...', 'spell book': 'spells / abilities', 'potions': '', # in party? 'party': 'party instance' }, 'tracked_values': { 'ct': 1000, # when c reaches this, unit gets a turn 'c': 0, # holds current charge value - +speed each clock tick in battle 'status_effects': [], 'elemental_resistance': 0, # from items (and toughness?) 'hp': '', 'mana': '', } }
new_npc_stats = {'base_stats': {'vit': 4, 'dex': 4, 'str': 4, 'int': 4, 'agility': 8, 'toughness': 9}, 'stats': {'max_hp': 'from vit', 'max_mana': 'from int?', 'armor': 'from str and toughness', 'magic_resistance': 'from toughness', 'speed': 'from dex and agility', 'dodge': 'from dex and speed', 'crit_chance': 'from dex', 'crit_dmg': 'from dex'}, 'storage': {'equipped items': 'armor, weapons, ...', 'spell book': 'spells / abilities', 'potions': '', 'party': 'party instance'}, 'tracked_values': {'ct': 1000, 'c': 0, 'status_effects': [], 'elemental_resistance': 0, 'hp': '', 'mana': ''}}
"""Custom shna errors.""" class ShnaError(Exception): """Custom shna exception class.""" pass
"""Custom shna errors.""" class Shnaerror(Exception): """Custom shna exception class.""" pass
#Create a function that accept a name and return reverse of this def reverse_name(a): reverse = "" for i in a: reverse = i + reverse return reverse name = input("Enter the NAME ") result = reverse_name(name) print("\nThe Reverse name is", result.title())
def reverse_name(a): reverse = '' for i in a: reverse = i + reverse return reverse name = input('Enter the NAME ') result = reverse_name(name) print('\nThe Reverse name is', result.title())
class InvalidInputsError(Exception): """ Raised during :class:`Service`'s :meth:`service_clean` method. Encapsulates both field_errors and non_field_errors into a single entity. :param dictionary errors: :class:`Services`'s ``errors`` dictionary :param dictionary non_field_errors: :class:`Service`'s ``non_field_errors`` dictionary """ def __init__(self, errors, non_field_errors): self.errors = errors self.non_field_errors = non_field_errors def __repr__(self): return '{}({}, {})'.format( type(self).__name__, repr(self.errors), repr(self.non_field_errors))
class Invalidinputserror(Exception): """ Raised during :class:`Service`'s :meth:`service_clean` method. Encapsulates both field_errors and non_field_errors into a single entity. :param dictionary errors: :class:`Services`'s ``errors`` dictionary :param dictionary non_field_errors: :class:`Service`'s ``non_field_errors`` dictionary """ def __init__(self, errors, non_field_errors): self.errors = errors self.non_field_errors = non_field_errors def __repr__(self): return '{}({}, {})'.format(type(self).__name__, repr(self.errors), repr(self.non_field_errors))
""" Ethereum Constantinople Hardfork ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Seventh Ethereum hardfork. """ MAINNET_FORK_BLOCK = 7280000 CHAIN_ID = 1
""" Ethereum Constantinople Hardfork ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Seventh Ethereum hardfork. """ mainnet_fork_block = 7280000 chain_id = 1
""" 0796. Rotate String We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A. Example 1: Input: A = 'abcde', B = 'cdeab' Output: true Example 2: Input: A = 'abcde', B = 'abced' Output: false Note: A and B will have length at most 100. """ class Solution: def rotateString(self, A: str, B: str) : if len(A) != len(B): return False elif not A and not B : return True else: for i in range(len(A)): if A[i:]+A[:i] == B: return True return False class Solution: def rotateString(self, A: str, B: str): if len(A) != len(B): return False elif not A and not B : return True else: if A in B*2: return True return False class Solution: def rotateString(self, A: str, B: str): return (len(A) == len(B)) and (B in A*2)
""" 0796. Rotate String We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True if and only if A can become B after some number of shifts on A. Example 1: Input: A = 'abcde', B = 'cdeab' Output: true Example 2: Input: A = 'abcde', B = 'abced' Output: false Note: A and B will have length at most 100. """ class Solution: def rotate_string(self, A: str, B: str): if len(A) != len(B): return False elif not A and (not B): return True else: for i in range(len(A)): if A[i:] + A[:i] == B: return True return False class Solution: def rotate_string(self, A: str, B: str): if len(A) != len(B): return False elif not A and (not B): return True else: if A in B * 2: return True return False class Solution: def rotate_string(self, A: str, B: str): return len(A) == len(B) and B in A * 2