Convert UUID filter.
555431
def conv_uuid(self, column, name, **kwargs):
        """"""
        return [f(column, name, **kwargs) for f in self.uuid_filters]
984916
def bytes2uuid(b):
    
    if b.strip(chr(0)) == '':
        return None

    s = b.encode('hex')
    return "%s-%s-%s-%s-%s" % (s[0:8], s[8:12], s[12:16], s[16:20], s[20:])
814642
def uuid5(namespace, name):
    """"""
    import sha
    hash = sha.sha(namespace.bytes + name).digest()
    return UUID(bytes=hash[:16], version=5)
1120410
static public function convert($uuid, $from, $to) {
    $conv = self::$m_convert[$from][$to];
    if (!isset($conv))
      return ($uuid);

    return (self::$conv($uuid));
  }
212039
function uuids (count, callback) {
    if (typeof count === 'function') {
      callback = count
      count = 1
    }
    return relax({ method: 'GET', path: '_uuids', qs: { count: count } }, callback)
  }
447560
def uuid_to_uid(uuid)
      uuid = Integer(uuid)
      if uuid >= 0 && uuid <= MAX_UUID
        10_000 + uuid
      else
        raise RangeError, "#{uuid} is not within (0..#{MAX_UUID})"
      end
    end
844295
def valid_uuid(value):
    

    try:
        uuid.UUID(value, version=4)
        return True
    except (TypeError, ValueError, AttributeError):
        return False
550119
public static function filterByUuid($filter)
    {
        $operator = Arr::get($filter, 'operator');
        $method = Arr::get($filter, 'method');
        $arguments = Arr::get($filter, 'arguments');
        $value_one = Arr::get($filter, 'value_one');
        $value_two = Arr::get($filter, 'value_two');
        $settings = Arr::get($filter, 'settings');
        $positive = Arr::get($filter, 'positive');

        switch ($operator) {
            case 'IN':
                $method = 'whereIn';
                $arguments = [static::getListFromString($value_one)];
                break;
            case 'NOT_IN':
                $method = 'whereNotIn';
                $arguments = [static::getListFromString($value_one)];
                break;
            case 'NULL':
                $method = 'whereNull';
                break;
            case 'NOT_NULL':
                $method = 'whereNotNull';
                break;
        }

        return [
            'operator'  => $operator,
            'method'    => $method,
            'arguments' => $arguments,
            'value_one' => $value_one,
            'value_two' => $value_two,
            'settings'  => $settings,
            'positive'  => $positive,
        ];
    }
188781
def mods(self, uuid):
        """"""
        picker = lambda x: x.get('mods', {})
        return self._get(('mods', uuid), picker)
504477
def uuid4():
    """"""
    # Otherwise, get randomness from urandom or the 'random' module.
    try:
        import os
        return UUID(bytes=os.urandom(16), version=4)
    except Exception:
        import random
        bytes = [chr(random.randrange(256)) for i in range(16)]
        return UUID(bytes=bytes, version=4)
1202399
def uuid(self, **params):

        

        digest = str(uuidlib.uuid4()).replace('-', '')
        return self.humanize(digest, **params), digest
642688
def _validated(self, value):
        """"""
        if value is None:
            return None
        if isinstance(value, uuid.UUID):
            return value
        try:
            if isinstance(value, bytes) and len(value) == 16:
                return uuid.UUID(bytes=value)
            else:
                return uuid.UUID(value)
        except (ValueError, AttributeError, TypeError):
            self.fail('invalid_uuid')
1118521
def from_rep(u):
        """"""
        if isinstance(u, pyversion.string_types):
            return uuid.UUID(u)

        # hack to remove signs
        a = ctypes.c_ulong(u[0])
        b = ctypes.c_ulong(u[1])
        combined = a.value << 64 | b.value
        return uuid.UUID(int=combined)
622900
def get_uuid(obj):
    """"""
    # TODO: deprecate null uuid ret val
    from uuid import UUID
    try:
        uuid = obj.attrs['uuid']
    except KeyError:
        return UUID(int=0)
    # convert to unicode for python 3
    try:
        uuid = uuid.decode('ascii')
    except (LookupError, AttributeError):
        pass
    return UUID(uuid)
634514
def validate_uuid(value):
    

    if value and not isinstance(value, UUID):
        try:
            return UUID(str(value), version=4)
        except (AttributeError, ValueError):
            raise ValidationError('not a valid UUID')
    return value
158192
def replace_uuid_w_names(self, resp):
        
        
        col_mapper = self.get_point_name(resp.context)["?point"].to_dict()
        resp.df.rename(columns=col_mapper, inplace=True)
        return resp
327704
def uuid4(self):
    """"""
    return ''.join([hexchars[self.randint(0,15)] for x in range(0,8)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,4)]) + '-' +\
           '4'+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           uuid4special[self.randint(0,3)]+''.join([hexchars[self.randint(0,15)] for x in range(0,3)]) + '-' +\
           ''.join([hexchars[self.randint(0,15)] for x in range(0,12)])