def get_snips_by_tag(self, tag):
        snips = []
        tag_id = None
        # get ID of tag
        r = requests.get(URL % 'tag/', headers=HEADERS)
        try:
            data = json.loads(r.content)
            objs = data.get('objects', [])
            if objs:
                tag_id = [x.get('id') for x in objs if x.get('name') == tag][0]
            if tag_id:
                r = requests.get(URL % 'snipt/?tag={0}'.format(tag_id), headers=HEADERS)
                objs = json.loads(r.content).get('objects')
                snips = objs
        except Exception:
            logging.debug('Unable to find snip: {0}'.format(tag))
        return snips
Allocates a range of IDs of size or with max for the given key.
dataset/ETHPy150Open honza/nigel/matchers/gifter.py/GifterMatcher.get_snips_by_tag--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/datastore.py/AllocateIds