Generates and returns a base LSID
        :return:
497141
def _generate_base_lsid(self):
        
        domain = self._generate_domain()
        namespace = self._generate_namespace()

        # Return the base LSID
        return "urn:lsid:" + domain + ":" + namespace
54820
def uid(i):
    

    o=i.get('out','')

    r=gen_uid({})
    if r['return']>0: return r

    if o=='con':
       out(r['data_uid'])

    return r
1003806
def get_jid(returner, jid):
    '''
    
    '''
    returners = salt.loader.returners(__opts__, __salt__)
    return returners['{0}.get_jid'.format(returner)](jid)
1314381
def _generateGUID(slnfile, name):
    """"""
    m = hashlib.md5()
    # Normalize the slnfile path to a Windows path (\ separators) so
    # the generated file has a consistent GUID even if we generate
    # it on a non-Windows platform.
    m.update(bytearray(ntpath.normpath(str(slnfile)) + str(name),'utf-8'))
    solution = m.hexdigest().upper()
    # convert most of the signature to GUID form (discard the rest)
    solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16] + "-" + solution[16:20] + "-" + solution[20:32] + "}"
    return solution
381399
async def gen(self, name):
        '''
        
        '''
        if self.ctor is None:
            raise s_exc.NoSuchCtor(name=name, mesg='BaseRef.gen() requires ctor')

        base = self.base_by_name.get(name)

        if base is None:
            base = await self.ctor(name)
            self.put(name, base)
        else:
            base.incref()

        return base
421740
def get_sysid(self):
        ''''''
        component = self.target_component
        if component == 0:
            component = 1
        return (self.target_system, component)
502165
def gen_table(self):
        
        table_length = 1 << self.TableIdxWidth
        tbl = [0] * table_length
        for i in range(table_length):
            register = i
            if self.ReflectIn:
                register = self.reflect(register, self.TableIdxWidth)
            register = register << (self.Width - self.TableIdxWidth + self.CrcShift)
            for j in range(self.TableIdxWidth):
                if register & (self.MSB_Mask << self.CrcShift) != 0:
                    register = (register << 1) ^ (self.Poly << self.CrcShift)
                else:
                    register = (register << 1)
            if self.ReflectIn:
                register = self.reflect(register >> self.CrcShift, self.Width) << self.CrcShift
            tbl[i] = register & (self.Mask << self.CrcShift)
        return tbl
429758
def generate_i
      return (begin
        bytes = (time_low << 96) + (time_mid << 80) +
          (time_hi_and_version << 64) + (clock_seq_hi_and_reserved << 56) +
          (clock_seq_low << 48)
        for i in 0..5
          bytes += (nodes[i] << (40 - (i * 8)))
        end
        bytes
      end)
    end
734094
def get_presig(self, target, source, env, executor=None):
        
        return self._generate(target, source, env, 1, executor).get_presig(target, source, env)
104839
def generate(self):
        

        result = self._gen(self.optimized, self.splitstring)
        if self.splitstring and result is not None:
            result = result[1:]
        return result
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
178552
def base(self, du):
        """"""
        parameter = 'base'
        if parameter not in self._by:
            self._by[parameter] = {}
            for clb in self.upi.values():
                if clb.floor == 0:
                    self._by[parameter][clb.du] = clb
        return self._by[parameter][du]
1327556
def _valid_lsid(self):
        
        if not isinstance(self.lsid, str):
            raise TypeError("lsid is not a string, string expected: " + str(self.lsid))

        if self.lsid.count(':') != 4:
            raise ValueError("lsid contains incorrect number of colons, 4 expected: " + str(self.lsid))

        if self.lsid.split(':')[0].lower() != 'urn':
            raise ValueError("lsid does not begin with urn: " + str(self.lsid))

        # If an LSID authority is specified, check with the authority
        if self.lsid_authority:
            if not self.lsid_authority.validate(self.lsid, check_existing=False):
                raise ValueError("lsid does not the authority: " + str(self.lsid))
657436
def in_base(self, base):
        
        if base == self.base:
            return copy.deepcopy(self)
        (result, _) = Radices.from_rational(self.as_rational(), base)
        return result
1098334
def lzwdecode(data):
    
    fp = BytesIO(data)
    return b''.join(LZWDecoder(fp).run())
1056893
def generate_uid():
    
    # first must be a letter
    first = random.choice(string.ascii_letters)
    # rest must be letters or numbers
    rest = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(10))
    return first + rest
74718
def iter_bases(bases):
        

        sequences = ([list(inspect.getmro(base)) for base in bases] +
                     [list(bases)])

        # Loop over sequences
        while True:
            sequences = [seq for seq in sequences if seq]
            if not sequences:
                return

            # Select a good head
            for seq in sequences:
                head = seq[0]

                tails = [seq for seq in sequences if head in seq[1:]]
                if not tails:
                    break
            else:
                raise TypeError('Cannot create a consistent method '
                                'resolution order (MRO) for bases %s' %
                                ', '.join([base.__name__ for base in bases]))

            # Yield this base class
            yield head

            # Remove base class from all the other sequences
            for seq in sequences:
                if seq[0] == head:
                    del seq[0]