Did I find the right examples for you? yes no

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)
Returns seq broken in a list of strings of length length 

        def split_len(seq, length):
    """ Returns seq broken in a list of strings of length length """
    return [seq[i:i+length] for i in range(0, len(seq), length)]
        


src/c/o/confine-controller-0.10.5/controller/apps/slices/ifaces.py   confine-controller(Download)
from django.core.exceptions import ValidationError
from IPy import IP
 
from controller.settings import DEBUG_IPV6_PREFIX
from controller.utils.ip import int_to_hex_str, split_len
        ipv6_words = DEBUG_IPV6_PREFIX.split(':')[:3]
        ipv6_words.extend([node_id, nr])
        ipv6_words.extend(split_len(slice_id, 4))
        return IP(':'.join(ipv6_words))
 
        ipv6_words = iface.sliver.node.get_priv_ipv6_prefix().split(':')[:3]
        ipv6_words.extend(['0', nr])
        ipv6_words.extend(split_len(slice_id, 4))
        return IP(':'.join(ipv6_words))
 

src/c/o/confine-controller-0.10.5/controller/apps/mgmtnetworks/tinc/models.py   confine-controller(Download)
from controller.models.fields import RSAPublicKeyField
from controller.models.utils import generate_chainer_manager
from controller.utils.ip import split_len, int_to_hex_str
from controller.core.validators import validate_host_name, validate_name, OrValidator
from nodes.models import Server, Node
            # MGMT_IPV6_PREFIX:0:0001:gggg:gggg:gggg/128
            ipv6_words.extend(['0', '0001'])
            ipv6_words.extend(split_len(int_to_hex_str(self.object_id, 12), 4))
            return IP(':'.join(ipv6_words))
 
            # MGMT_IPV6_PREFIX:0:2000:hhhh:hhhh:hhhh/128
            ipv6_words.extend(['0', '2000'])
            ipv6_words.extend(split_len(int_to_hex_str(self.object_id, 12), 4))
            return IP(':'.join(ipv6_words))
 

src/c/o/confine-controller-0.10.5/controller/apps/mgmtnetworks/tinc/ifaces.py   confine-controller(Download)
from IPy import IP
 
from controller.settings import MGMT_IPV6_PREFIX
from controller.utils.ip import int_to_hex_str, split_len
from slices.ifaces import BaseIface
        ipv6_words = MGMT_IPV6_PREFIX.split(':')[:3]
        ipv6_words.extend([node_id, nr])
        ipv6_words.extend(split_len(slice_id, 4))
        return IP(':'.join(ipv6_words))