Given the raw bytes containing the property-flags and property-list
        from a content-frame-header, parse and insert into a dictionary
        stored in this object as an attribute named 'properties'.
193633
def _load_properties(self, raw_bytes):
        """"""
        r = AMQPReader(raw_bytes)

        #
        # Read 16-bit shorts until we get one with a low bit set to zero
        #
        flags = []
        while 1:
            flag_bits = r.read_short()
            flags.append(flag_bits)
            if flag_bits & 1 == 0:
                break

        shift = 0
        d = {}
        for key, proptype in self.PROPERTIES:
            if shift == 0:
                if not flags:
                    break
                flag_bits, flags = flags[0], flags[1:]
                shift = 15
            if flag_bits & (1 << shift):
                d[key] = getattr(r, 'read_' + proptype)()
            shift -= 1

        self.properties = d
641430
def dump(self, dump_file_name=None):  # pragma: no cover, never called
        # pylint: disable=unused-argument
        
        dump = {}
        for prop in self.properties:
            if not hasattr(self, prop):
                continue
            attr = getattr(self, prop)
            if isinstance(attr, list) and attr and isinstance(attr[0], Item):
                dump[prop] = [i.dump() for i in attr]
            elif isinstance(attr, Item):
                dump[prop] = attr.dump()
            elif attr:
                dump[prop] = getattr(self, prop)
        return dump
696162
def from_bytes(rawbytes):
        '''
        
        '''
        ipopts = IPOptionList()

        i = 0
        while i < len(rawbytes):
            opttype = rawbytes[i]
            optcopied = opttype >> 7         # high order 1 bit
            optclass = (opttype >> 5) & 0x03 # next 2 bits
            optnum = opttype & 0x1f          # low-order 5 bits are optnum
            optnum = IPOptionNumber(optnum)
            obj = IPOptionClasses[optnum]()
            eaten = obj.from_bytes(rawbytes[i:])
            i += eaten
            ipopts.append(obj)
        return ipopts
943475
function insertProperty (fixer, node, propertyText) {
      if (node.properties.length === 0) {
        return fixer.replaceText(node, `{\n${propertyText}\n}`);
      }
      return fixer.insertTextAfter(
        sourceCode.getLastToken(node.properties[node.properties.length - 1]),
        `,\n${propertyText}`
      );
    }
312306
def insert (self, properties, value):
        
        assert is_iterable_typed(properties, basestring)
        assert isinstance(value, basestring)
        self.__properties.append(properties)
        self.__values.append(value)
1048754
def copy(self):
        
        properties = {}
        for key, value in self.raw_values.items():
            if key in self.UnhashableOptions:
                properties[key] = value
            else:
                properties[key] = copy.copy(value)

        return Context(**properties)
1161439
def __initializeFromRaw(self):
        """"""

        for (key, value) in self.raw_data.items():
            if key.startswith("@"):
                # be compatible with IncludedInBuild
                if "@oslc_cm:label" != key:
                    continue

            attr = key.split(":")[-1].replace("-", "_")
            attr_list = attr.split(".")

            # ignore long attributes
            if len(attr_list) > 1:
                # attr = "_".join([attr_list[-2],
                #                  attr_list[-1]])
                continue

            self.field_alias[attr] = key

            if isinstance(value, OrderedDict):
                value_text = value.get("#text")
                if value_text is not None:
                    value = value_text
                else:
                    # request detailed info using rdf:resource
                    value = list(value.values())[0]

                    try:
                        value = self.__get_rdf_resource_title(value)
                    except (exception.RTCException, Exception):
                        self.log.error("Unable to handle %s", value)
            self.setattr(attr, value)
1140669
def from_bytes(self, raw):
        ''''''
        if len(raw) < 4:
            raise NotEnoughDataError("Not enough bytes ({}) to reconstruct a Null object".format(len(raw)))
        fields = struct.unpack('=I', raw[:4])
        self._af = fields[0]
        return raw[4:]
949255
def from_raw_data(cls, item_raw):
        
        deserialized = {}
        for name, value in item_raw.items():
            attr = getattr(cls, name, None)
            if attr is None:
                continue
            deserialized[name] = attr.decode(value)
        return cls(**deserialized)
627885
def put_attributes(self, attrs):
        
        assert(isinstance(attrs, dict)), "Argument must be a dict of key->values to save"
        for prop_name in attrs:
            value = attrs[prop_name]
            prop = self.find_property(prop_name)
            assert(prop), "Property not found: %s" % prop_name
            self._manager.set_property(prop, self, prop_name, value)
        self.reload()
        return self
34561
def append_with(self, obj, **properties):
        ''''''
        for prop, val in properties.items():
            val = self.serialize(val)
            self._meta.setdefault(prop, {}).setdefault(val, []).append(obj)
        self.append(obj)
532100
def list_properties(cls):
    
    rtn_dict = {}
    for attr in dir(cls):
        if attr not in ["properties", "__doc__", "doc"]:
            attr_val = getattr(cls, attr)

            if isinstance(attr_val, MODULE.rdfclass.RdfPropertyMeta):
                rtn_dict[attr] = attr_val
    return rtn_dict
509683
def update_from_dict(self, dct):
        
        if not dct:
            return
        all_props = self.__class__.CONFIG_PROPERTIES
        for key, value in six.iteritems(dct):
            attr_config = all_props.get(key)
            if attr_config:
                setattr(self, key, value)
            else:
                self.update_default_from_dict(key, value)
193539
def _parse_properties(self, properties):
        
        props = {}
        # TODO: clean up prop_dict?
        prop_dict = OrderedDict()
        # We use a dict instead of list to provide for a richer syntax
        for p in properties:
            if p in self.aliases:
                if isinstance(properties, dict):
                    props[self.aliases[p]] = properties[p]
                else:
                    props[self.aliases[p]] = 1
                prop_dict[p] = self.aliases[p].split(".")
            else:
                if isinstance(properties, dict):
                    props[p] = properties[p]
                else:
                    props[p] = 1
                prop_dict[p] = p.split(".")
        # including a lower-level key after a higher level key e.g.:
        # {'output': 1, 'output.crystal': 1} instead of
        # {'output.crystal': 1, 'output': 1}
        # causes mongo to skip the other higher level keys.
        # this is a (sketchy) workaround for that. Note this problem
        # doesn't appear often in python2 because the dictionary ordering
        # is more stable.
        props = OrderedDict(sorted(props.items(), reverse=True))
        return props, prop_dict
1061624
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data["properties"]

        address_pools = []
        for content in properties.get("loadBalancerBackendAddressPools", []):
            resource = Resource.from_raw_data(content)
            address_pools.append(resource)
        properties["loadBalancerBackendAddressPools"] = address_pools

        nat_rules = []
        for content in properties.get("loadBalancerInboundNatRules", None):
            resource = Resource.from_raw_data(content)
            nat_rules.append(resource)
        properties["loadBalancerInboundNatRules"] = nat_rules

        raw_content = properties.get("publicIPAddress", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["publicIPAddress"] = resource

        raw_content = properties.get("serviceInsertion", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["serviceInsertion"] = resource

        raw_content = properties.get("subnet", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["subnet"] = resource

        return super(IPConfiguration, cls).process_raw_data(raw_data)
931825
private static Properties parseHeaderFields(String[] pHeaders) {
        Properties headers = new Properties();

        // Get header information
        int split;
        String field;
        String value;

        for (String header : pHeaders) {
            //System.err.println(pHeaders[i]);
            if ((split = header.indexOf(":")) > 0) {

                // Read & parse..?
                field = header.substring(0, split);
                value = header.substring(split + 1);

                //System.err.println(field + ": " + value.trim());
                headers.setProperty(StringUtil.toLowerCase(field), value.trim());
            }
        }
        return headers;
    }
67741
def process_raw_data(cls, raw_data):
        """"""
        properties = raw_data.get("properties", {})

        raw_content = properties.get("ipConfiguration", None)
        if raw_content is not None:
            resource = Resource.from_raw_data(raw_content)
            properties["ipConfiguration"] = resource

        return super(PublicIPAddresses, cls).process_raw_data(raw_data)