Generate the ID for post.
        :return: the new ID.
503395
def _gen_uid(self):
        '''
        
        '''
        cur_uid = self.kind + tools.get_uu4d()
        while MPost.get_by_uid(cur_uid):
            cur_uid = self.kind + tools.get_uu4d()
        return cur_uid
82352
def create_link(id_link, post_data):
        '''
        
        '''
        if MLink.get_by_uid(id_link):
            return False
        try:
            the_order = int(post_data['order'])
        except:
            the_order = 999
        TabLink.create(name=post_data['name'],
                       link=post_data['link'],
                       order=the_order,
                       logo=post_data['logo'] if 'logo' in post_data else '',
                       uid=id_link)
        return id_link
1284973
def generate_identity(self):
        
        identity = struct.pack('!BI', 0, self._base_identity)
        self._base_identity += 1

        if self._base_identity >= 2 ** 32:
            self._base_identity = 0

        return identity
566579
def make_msg_id():
    
    random_string = get_rand_string(12)
    timestamp = time.strftime("%Y%m%d%I%M%S")
    msg_id = timestamp + "-" + random_string
    return msg_id
860217
def id(self, id):
        

        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if len(id) > 255:
            raise ValueError("Invalid value for `id`, length must be less than `255`")

        self._id = id
288687
def _unique_id(self, prefix):
        
        _id = self._id_gen
        self._id_gen += 1
        return prefix + str(_id)
868099
def get_identities(self, item):
        

        # All identities are in the post stream
        # The first post is the question. Next replies

        posts = item['data']['post_stream']['posts']

        for post in posts:
            user = self.get_sh_identity(post)
            yield user
320871
def generate_minion_id():
    '''
    
    '''
    try:
        ret = salt.utils.stringutils.to_unicode(_generate_minion_id().first())
    except TypeError:
        ret = None
    return ret or 'localhost'
735214
def id_generator(size=15, random_state=None):
    """"""
    chars = list(string.ascii_uppercase + string.digits)
    return ''.join(random_state.choice(chars, size, replace=True))
590956
def from_id(reddit_session, subreddit_id):
        """"""
        pseudo_data = {'id': subreddit_id,
                       'permalink': '/comments/{0}'.format(subreddit_id)}
        return Submission(reddit_session, pseudo_data)
806926
def list_id(self):
        
        list_id = getattr(self, '_list_id', None)

        if list_id is None:
            for l in self.api.lists.all()['lists']:
                if l['name'] == self.list_name:
                    self._list_id = l['id']

            if not getattr(self, '_list_id', None):
                self._list_id = self.api.lists.create(
                    label=self.list_label, name=self.list_name,
                    method='POST')['list_id']

        return self._list_id
1322950
def target_id(self):
        """"""
        # already set?
        if self._target_id:
            return self._target_id
        # post already exists?
        if self._existing:
            self._target_id = self._existing.get("target_id")
        return self._target_id
1358830
def __new_request_id(self):
        
        while True:
            # Since seqnum wraps on 2^64 at most, this should always fit into 32 chars (QAPI request id limit)
            with self.__seqnum_lock:
                requestId = "%s%d" % (self.__reqpre, self.__reqnum)
            self.__reqnum += 1
            if requestId not in self.__requests:
                break
            # in the unlikely event of a collision update prefix
            self.__reqpre = self.__rnd_string(6)
        return requestId
13351
def string_id(self):
    
    id = self.id()
    if not isinstance(id, basestring):
      id = None
    return id
1290541
def id(self):
        
        if self._id is None:
            self._id = int(self._element.get('id'))
        return self._id
1160872
def create_unique_id(prefix, existing_ids):
    
    if prefix in existing_ids:
        suffix = 1
        while True:
            new_id = '{}_{}'.format(prefix, suffix)
            if new_id not in existing_ids:
                return new_id
            suffix += 1

    return prefix
664639
def params(self):
        
        if self._GETPOST is None:
            self._GETPOST = MultiDict(self.GET)
            self._GETPOST.update(dict(self.POST))
        return self._GETPOST