Extract all valuable properties to be displayed
188956
def extract_props(self, settings):
        '''
        
        '''

        props = {}

        for param in self.call_parameters:
            if param in settings:
                props[param] = settings[param]
            else:
                props[param] = None

        return props
1038929
def get_property(self):
        """"""
        scope = self

        def fget(self):
            """Call dynamic function then validate output"""
            scope.display_warning()
            return getattr(self, scope.new_name)

        def fset(self, value):
            """Validate and call setter"""
            scope.display_warning()
            setattr(self, scope.new_name, value)

        def fdel(self):
            """call deleter"""
            scope.display_warning()
            delattr(self, scope.new_name)

        return property(fget=fget, fset=fset, fdel=fdel, doc=scope.sphinx())
926254
def render_value(value):
    """"""
    if isinstance(value, list):
        return '[' + ', '.join(render_value(v) for v in value) + ']'
    elif isinstance(value, dict):
        return (
            '{' +
            ', '.join('{k!r}: {v}'.format(
                k=k, v=render_value(v)) for k, v in sorted(value.items())) +
            '}')
    else:
        return repr(value)
534514
def _get_properties(self, rule, p_selectors, p_parents, p_children, scope, media, c_lineno, c_property, c_codestr):
        
        prop, value = (_prop_split_re.split(c_property, 1) + [None])[:2]
        try:
            is_var = (c_property[len(prop)] == '=')
        except IndexError:
            is_var = False
        prop = prop.strip()
        prop = self.do_glob_math(
            prop, rule[CONTEXT], rule[OPTIONS], rule, True)
        if prop:
            if value:
                value = value.strip()
                value = self.calculate(
                    value, rule[CONTEXT], rule[OPTIONS], rule)
            _prop = (scope or '') + prop
            if is_var or prop.startswith('$') and value is not None:
                if isinstance(value, basestring):
                    if '!default' in value:
                        if _prop in rule[CONTEXT]:
                            value = None
                        else:
                            value = value.replace(
                                '!default', '').replace('  ', ' ').strip()
                elif isinstance(value, ListValue):
                    value = ListValue(value)
                    for k, v in value.value.items():
                        if v == '!default':
                            if _prop in rule[CONTEXT]:
                                value = None
                            else:
                                del value.value[k]
                                value = value.first(
                                ) if len(value) == 1 else value
                            break
                if value is not None:
                    rule[CONTEXT][_prop] = value
            else:
                _prop = self.apply_vars(
                    _prop, rule[CONTEXT], rule[OPTIONS], rule, True)
                rule[PROPERTIES].append((c_lineno, _prop,
                                         to_str(value) if value is not None else None))
771689
def _extract_value(self, value):
        """"""
        return ModelEndpoint._value_map.get(smart_str(value).lower(), value)
393850
def properties(self):
        """"""
        value = self._schema.get("properties", {})
        if not isinstance(value, dict):
            raise SchemaError(
                "properties value {0!r} is not an object".format(value))
        return value
38826
def get_property(self):
        """"""

        scope = self

        def fget(self):
            """Call the HasProperties _get method"""
            return self._get(scope.name)

        def fset(self, value):
            """Validate value and call the HasProperties _set method"""
            if value is not undefined:
                value = scope.validate(self, value)
            self._set(scope.name, value)

        def fdel(self):
            """Set value to utils.undefined on delete"""
            self._set(scope.name, undefined)

        return property(fget=fget, fset=fset, fdel=fdel, doc=scope.sphinx())
272588
def get_all_incoming_properties(self, params=None):
        
        if not params:
            params = {}
        return self._iterate_through_pages(
            self.get_incoming_properties_per_page,
            resource=INCOMING_PROPERTIES,
            **{'params': params}
        )
974247
def info(self):
        """"""
        itext = self.class_info
        if self.key_prop.info and self.value_prop.info:
            itext += ' (keys: {}; values: {})'.format(
                self.key_prop.info, self.value_prop.info
            )
        elif self.key_prop.info:
            itext += ' (keys: {})'.format(self.key_prop.info)
        elif self.value_prop.info:
            itext += ' (values: {})'.format(self.value_prop.info)
        return itext
1305873
function() {

            var data = {};
            var properties = this.__getPropertiesParam();

            for (var property in properties) {
                data[property] = this.__processData(this.__getPropertyValue(property));
            }

            return data;
        }
299145
def view_properties field=@form.get_current_field
    alert "Nil field" unless field
    return unless field
    text = ["Instance Variables"]
    text << "------------------"
    #iv = field.instance_variables.map do |v| v.to_s; end
    field.instance_variables.each do |v|
      val = field.instance_variable_get(v)
      klass = val.class
      if val.is_a? Array 
        val = val.size
      elsif val.is_a? Hash
        val = val.keys
      end
      case val
      when String, Integer, TrueClass, FalseClass, NilClass, Array, Hash, Symbol
        ;
      else
        val = "Not shown"
      end
      text << "%20s  %10s  %s" % [v, klass, val]
    end
    text << " "
    text << "Public Methods"
    text << "--------------"
    pm = field.public_methods(false).map do |v| v.to_s; end
    text +=  pm
    text << " "
    text << "Inherited Methods"
    text << "-----------------"
    pm = field.public_methods(true) - field.public_methods(false)
    pm = pm.map do |v| v.to_s; end
    text +=  pm

    #$log.debug "  view_properties #{s.size} , #{s} "
    textdialog text, :title => "Properties"
  end
840771
def _serialize_properties(self):
        """"""
        shift = 15
        flag_bits = 0
        flags = []
        raw_bytes = AMQPWriter()
        for key, proptype in self.PROPERTIES:
            val = self.properties.get(key, None)
            if val is not None:
                if shift == 0:
                    flags.append(flag_bits)
                    flag_bits = 0
                    shift = 15

                flag_bits |= (1 << shift)
                if proptype != 'bit':
                    getattr(raw_bytes, 'write_' + proptype)(val)

            shift -= 1

        flags.append(flag_bits)
        result = AMQPWriter()
        for flag_bits in flags:
            result.write_short(flag_bits)
        result.write(raw_bytes.getvalue())

        return result.getvalue()
1121775
def extract_object_properties(self, o, limit_size=False):
        
        try:
            prop_str = repr(o)[:512]
        except:
            prop_str = "Error while extracting value"

        _logger.e_debug("extract_object_properties(%s)", prop_str)
        var_list = []
        if isinstance(o, dict):
            a_var_name = None
            a_var_value = None
            for a_var_name in o:
                a_var_value = o[a_var_name]
                children_count = self.object_properties_count(a_var_value)
                v_name, v_value, v_type = self.extract_name_value_type(a_var_name, 
                                                                       a_var_value, 
                                                                       limit_size=limit_size)
                a_var_info = {
                    'id': id(a_var_value),
                    'name': v_name,
                    'type': "%s%s" % (v_type, " [%s]" % children_count if children_count else '',),
                    'value': v_value,
                    'children_count': children_count,
                }
                var_list.append(a_var_info)
                
        elif type(o) in (list, tuple, set,):
            MAX_CHILDREN_TO_RETURN = 256
            MAX_CHILDREN_MESSAGE = "Truncated by ikpdb (don't hot change me !)."
            a_var_name = None
            a_var_value = None
            do_truncate = len(o) > MAX_CHILDREN_TO_RETURN
            for idx, a_var_value in enumerate(o):
                children_count = self.object_properties_count(a_var_value)
                v_name, v_value, v_type = self.extract_name_value_type(idx, 
                                                                       a_var_value, 
                                                                       limit_size=limit_size)
                var_list.append({
                    'id': id(a_var_value),
                    'name': v_name,
                    'type': "%s%s" % (v_type, " [%s]" % children_count if children_count else '',),
                    'value': v_value,
                    'children_count': children_count,
                })
                if do_truncate and idx==MAX_CHILDREN_TO_RETURN-1:
                    var_list.append({
                        'id': None,
                        'name': str(MAX_CHILDREN_TO_RETURN),
                        'type': '',
                        'value': MAX_CHILDREN_MESSAGE,
                        'children_count': 0,
                    })
                    break
        else:
            a_var_name = None
            a_var_value = None
            if hasattr(o, '__dict__'):
                for a_var_name, a_var_value in o.__dict__.items():
                    if (not a_var_name.startswith('__') 
                        and not type(a_var_value) in (types.ModuleType, 
                                                      types.MethodType, 
                                                      types.FunctionType,)):
                        children_count = self.object_properties_count(a_var_value)
                        v_name, v_value, v_type = self.extract_name_value_type(a_var_name,
                                                                               a_var_value, 
                                                                               limit_size=limit_size)
                        var_list.append({
                            'id': id(a_var_value),
                            'name': v_name,
                            'type': "%s%s" % (v_type, " [%s]" % children_count if children_count else '',),
                            'value': v_value,
                            'children_count': children_count,
                        })
        return var_list
1112079
def __extractProperties(self):
        
        self.properties = [] # @todo: keep adding?
        self.annotationProperties = []
        self.objectProperties = []
        self.datatypeProperties = []

        qres = self.queryHelper.getAllProperties()

        for candidate in qres:

            test_existing_prop = self.getProperty(uri=candidate[0])
            if not test_existing_prop:
                # create it
                self.properties += [OntoProperty(candidate[0], candidate[1], self.namespaces)]
            else:
                # update it
                if candidate[1] and (test_existing_prop.rdftype == rdflib.RDF.Property):
                    test_existing_prop.rdftype = inferMainPropertyType(candidate[1])


        #add more data
        for aProp in self.properties:

            if aProp.rdftype == rdflib.OWL.DatatypeProperty:
                self.datatypeProperties += [aProp]
            elif aProp.rdftype == rdflib.OWL.AnnotationProperty:
                self.annotationProperties += [aProp]
            elif aProp.rdftype == rdflib.OWL.ObjectProperty:
                self.objectProperties += [aProp]
            else:
                pass

            aProp.triples = self.queryHelper.entityTriples(aProp.uri)
            aProp._buildGraph() # force construction of mini graph

            # attach to an ontology [2015-06-15: no property type distinction yet]
            for uri in aProp.getValuesForProperty(rdflib.RDFS.isDefinedBy):
                onto = self.getOntology(str(uri))
                if onto:
                    onto.properties += [aProp]
                    aProp.ontology = onto



            self.__buildDomainRanges(aProp)

            # add direct Supers
            directSupers = self.queryHelper.getPropDirectSupers(aProp.uri)

            for x in directSupers:
                superprop = self.getProperty(uri=x[0])
                if superprop:
                    aProp._parents.append(superprop)

                    # add inverse relationships (= direct subs for superprop)
                    if aProp not in superprop.children():
                         superprop._children.append(aProp)
682817
def styleProperties(Class, style):
        
        properties = Dict()
        for property in style.getProperties(all=True):
            stylename = property.name + ':'
            properties[stylename] = property.value
            if property.priority != '':
                properties[stylename] = ' !'+property.priority
        return properties
845329
def _extract_key_value(obj):
    """"""
    key = None; value = None

    # Parse a Value object, which includes Properties
    if isinstance(obj, Value):
        key = _construct_new_key(obj.name, obj.units)
        value = []
        if obj.scalars:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.scalars]
        elif obj.vectors and len(obj.vectors) == 1:
            value = [(val.value if isinstance(val, Scalar) else val)
                     for val in obj.vectors[0]]
        if len(value) == 1:
            value = value[0]
        elif len(value) == 0:
            value = None

    # If there is a process step, pul out its name as the value
    # TODO: resolve duplicates
    if isinstance(obj, ProcessStep):
        key = "Processing"
        value = obj.name
        
    return key, value
503443
function toProperties(variables) {
  const categories = Object.keys(variables);
  const valueOf = (category, value) => {
    let retVal;

    if (category === 'color') {
      retVal = `rgb(${value.r}, ${value.g}, ${value.b})`;
    } else if (category === 'font-family') {
      retVal = value
        .map(font => {
          return font.indexOf(' ') === -1 ? font : `'${font}'`;
        })
        .join(', ');
    } else {
      retVal = value;
    }

    return retVal;
  };

  return categories.reduce((retVal, category) => {
    const keys = Object.keys(variables[category]);

    keys.forEach(key => {
      const value = valueOf(category, variables[category][key]);
      const _key = key.length > 0 ? `${category}-${key}` : `${category}`;

      retVal.push(`--zd-${_key}: ${value};`);
    });

    return retVal;
  }, []);
}