See :meth:`AbstractElement.json`
191526
def json(self,attribs =None, recurse=True, ignorelist=False):
        """"""
        if not attribs: attribs = {}
        if self.idref:
            attribs['id'] = self.idref
        return super(AbstractTextMarkup,self).json(attribs,recurse, ignorelist)
308631
@Override
    public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
        if (src == null) {
            return JsonNull.INSTANCE;
        } else {
            return new JsonPrimitive(apiClient.formatDatetime(src));
        }
    }
1168014
def ToJson(self):
        
        jsn = super(InvocationTransaction, self).ToJson()
        jsn['script'] = self.Script.hex()
        jsn['gas'] = self.Gas.ToNeoJsonString()
        return jsn
848517
function inverseConvertHelper(arrayElement, id) {
  let elementJson = new Object();
  elementJson.id = ++id;

  if (typeof arrayElement === 'string') {
    elementJson.type = 'textnode';
    elementJson.value = arrayElement;
  } else if (['var', 'derived', 'data', 'meta'].indexOf(arrayElement[0]) > -1) {
    elementJson.type = arrayElement[0];
    elementJson.properties = {};
    arrayElement[1].forEach(property => {
      elementJson.properties[property[0]] = {
        type: property[1][0],
        value: property[1][1]
      };
    });
  } else {
    elementJson.type = 'component';
    elementJson.name = arrayElement[0];
    if (arrayElement[1].length !== 0) {
      elementJson.properties = {};
      arrayElement[1].forEach(property => {
        elementJson.properties[property[0]] = {
          type: property[1][0],
          value: property[1][1]
        };
      });
    }
    if (arrayElement[2]) {
      let children = [];
      arrayElement[2].forEach(element => {
        let childData = inverseConvertHelper(element, id);
        id = childData.id;
        children.push(childData.data);
      });
      elementJson.children = children;
    }
  }
  let result = new Object();
  result.id = id;
  result.data = elementJson;
  return result;
}
1188566
function asJson(entity, shallow) {
  let json;

  try {
    json = JSON.stringify(asObject(entity, shallow));
  } catch (error) {
    json = '';
  }

  return json;
}
145081
def pb2json(pb):
    '''  '''
    js = {}
    # fields = pb.DESCRIPTOR.fields #all fields
    fields = pb.ListFields()    #only filled (including extensions)
    for field,value in fields:
        if field.type == FD.TYPE_MESSAGE:
            ftype = pb2json
        elif field.type == FD.TYPE_ENUM:
            ftype = lambda x: field.enum_type.values[x].name
        elif field.type in _ftype2js:
            ftype = _ftype2js[field.type]
        else:
            raise ParseError("Field %s.%s of type '%d' is not supported" % (pb.__class__.__name__, field.name, field.type, ))
        if field.label == FD.LABEL_REPEATED:
            js_value = []
            for v in value:
                js_value.append(ftype(v))
        else:
            js_value = ftype(value)
        js[field.name] = js_value
    return js
348744
def json_string(self):
        
        def visit_children(node):
            """ Recursively visit the fragments_tree """
            output_fragments = []
            for child in node.children_not_empty:
                fragment = child.value
                text = fragment.text_fragment
                output_fragments.append({
                    "id": text.identifier,
                    "language": text.language,
                    "lines": text.lines,
                    "begin": gf.time_to_ssmmm(fragment.begin),
                    "end": gf.time_to_ssmmm(fragment.end),
                    "children": visit_children(child)
                })
            return output_fragments
        output_fragments = visit_children(self.fragments_tree)
        return gf.safe_unicode(
            json.dumps({"fragments": output_fragments}, indent=1, sort_keys=True)
        )
888301
def json_repr(self, minimal=False):
        
        if self.value:
            return [self.field, self.operator, self.value]
        else:
            return [self.field, self.operator]
33046
def as_json(_options = {})
      {
        resource_owner_id: resource_owner_id,
        scope: scopes,
        expires_in: expires_in_seconds,
        application: { uid: application.try(:uid) },
        created_at: created_at.to_i,
      }
    end
1080076
def find_json(raw):
    '''
    
    '''
    ret = {}
    lines = __split(raw)
    for ind, _ in enumerate(lines):
        try:
            working = '\n'.join(lines[ind:])
        except UnicodeDecodeError:
            working = '\n'.join(salt.utils.data.decode(lines[ind:]))

        try:
            ret = json.loads(working)  # future lint: blacklisted-function
        except ValueError:
            continue
        if ret:
            return ret
    if not ret:
        # Not json, raise an error
        raise ValueError
280002
def digest_json(soup):
    """"""
    abstract_tags = raw_parser.abstract(soup, abstract_type="executive-summary")
    abstract_json = None
    for tag in abstract_tags:
        abstract_json = render_abstract_json(tag)
    return abstract_json
592642
def element_info_as_json_with_filter(name, _filter):
    
    if name and _filter:
        element = fetch_meta_by_name(name, filter_context=_filter)
        if element.json:
            return element.json
820857
function fromJSON(json, into) {
  var form;

  // ensure the items are wrapped as atoms (with parents) all the way down
  if(Array.isArray(json)) {
    form = into || list();
    json.forEach(function(elem) {
      form.push(fromJSON(elem));
    });
  }
  else if(isPrimitive(json) || (isToken(json) && !isAtom(json))) {
    form = atom(json);
  }
  else if(isList(json) || isAtom(json)) {
    // nothing to do:
    form = json;
  }
  else {
      throw new Error('Unsupported element type in fromJSON: ' + json +
                  ' (type is \'' + typeof json + '\')');
  }

  return form;
}
417679
def as_json(only: nil, except: nil, context: {})
      execute(Introspection::INTROSPECTION_QUERY, only: only, except: except, context: context).to_h
    end
304693
def serialise(self, element: Element) -> str:
        

        return json.dumps(self.serialise_element(element))
879149
def json(self):
        '''  '''
        ctype = self.environ.get('CONTENT_TYPE', '').lower().split(';')[0]
        if ctype == 'application/json':
            b = self._get_body_string()
            if not b:
                return None
            return json_loads(b)
        return None
516361
def pb2json(pb, useFieldNumber=False):
    '''  '''
    js = {}
    # fields = pb.DESCRIPTOR.fields #all fields
    fields = pb.ListFields()        #only filled (including extensions)
    for field,value in fields:
        if useFieldNumber:
            key = field.number
        else:
            key = field.name
        if field.type == FD.TYPE_MESSAGE:
            ftype = partial(pb2json, useFieldNumber=useFieldNumber)
        elif field.type in _ftype2js:
            ftype = _ftype2js[field.type]
        else:
            raise ParseError("Field %s.%s of type '%d' is not supported" % (pb.__class__.__name__, field.name, field.type, ))
        if field.label == FD.LABEL_REPEATED:
            js_value = []
            for v in value:
                js_value.append(ftype(v))
        else:
            js_value = ftype(value)
        js[key] = js_value
    return js