/*!
Applies virtuals properties to `json`.

@param {GraphObject} self
@param {Object} json
@param {String} type either `virtuals` or `paths`
@return {Object} `json`
767486
function applyGetters (self, json, type, options) {
  var schema = self.schema
    , paths = Object.keys(schema[type])
    , i = paths.length
    , path;


  while (i--) {
    path = paths[i];
    json[path] = clone(self.get(path), options);
  }

  return json;
}
780942
function(json){
    
    // Protect against forgetting the new keyword when calling the constructor
    if(!(this instanceof Links)){
      return new Links(json);
    }
    
    // If the given object is already an instance then just return it. DON'T copy it.
    if(Links.isInstance(json)){
      return json;
    }
    
    this.init(json);
  }
1001558
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Address)){
    return new Address(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Address.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
1219807
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof OnlineAccount)){
    return new OnlineAccount(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(OnlineAccount.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
961850
function jsonSchemaTypeToGraphQL(jsonSchemaType, schemaName) {
  if (jsonSchemaType === "array") {
    if (graphQLObjectTypes[schemaName]) {
      return new GraphQLList(graphQLObjectTypes[schemaName]);
    } else {
      const translated = {
        pilots: "people",
        characters: "people",
        residents: "people"
      }[schemaName];

      if (! translated) {
        throw new Error(`no type ${schemaName}`);
      }

      const type = graphQLObjectTypes[translated];

      if (! type) {
        throw new Error(`no GraphQL type ${schemaName}`);
      }

      return new GraphQLList(type);
    }
  }

  return {
    string: GraphQLString,
    date: GraphQLString,
    integer: GraphQLInt,
  }[jsonSchemaType];
}
216986
function JSONDiff () {
  var self = this

  self.klass = JSONDiff;
  self.klass.super_.apply(self, arguments);

  self.engine = require('json-diff');
}
38516
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Root)){
    return new Root(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Root.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
578723
function generateSVGObject(parent, type) {
  let namespace = parent.namespaceURI;
  let node = namespace ? document.createElementNS(namespace, type)
    : document.createElement(type);
  parent.appendChild(node);
  return node;
}
492262
function doGeojson(g) {
    console.log("GEOJSON",g);
    if (!basemaps["geojson"]) {
        var opt = { style: function(feature) {
                var st = { stroke:true, color:"#910000", weight:2, fill:true, fillColor:"#910000", fillOpacity:0.3 };
                if (feature.hasOwnProperty("properties")) {
                    console.log("GPROPS", feature.properties)
                }
                if (feature.hasOwnProperty("style")) {
                    console.log("GSTYLE", feature.style)
                }
                return st;
            }
        }
        opt.onEachFeature = function (f,l) {
            if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
        }
        overlays["geojson"] = L.geoJson(g,opt);
        layercontrol.addOverlay(overlays["geojson"],"geojson");
    }
    overlays["geojson"].addData(g);
}
216135
public static <T> T fromJson(final String json, final JavaType type) {
        try {
            return createObjectMapper().readValue(json, type);
        } catch (Exception e) {
            throw new ParseException(e);
        }
    }
316848
public static ConfigurableJsonFluentAssert assertThatJson(Object json) {
        return new ConfigurableJsonFluentAssert(convertToJson(json, ACTUAL), getPathPrefix(json));
    }
1062111
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Base)){
    return new Base(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Base.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
450666
function reqToJSON () {
  const {ip, method, url, headers} = this
  const userAgent = headers ? headers['user-agent'] : void (0)
  return {ip, method, url, userAgent}
}
921016
def self(options = {})
      ret = send_get_request(@conn, ['/v1/agent/self'], options)
      JSON.parse(ret.body).tap { |node| OpenStruct.new node }
    end
104845
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof ResourceReference)){
    return new ResourceReference(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(ResourceReference.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
1030612
function(json){
    
    // Protect against forgetting the new keyword when calling the constructor
    if(!(this instanceof Link)){
      return new Link(json);
    }
    
    // If the given object is already an instance then just return it. DON'T copy it.
    if(Link.isInstance(json)){
      return json;
    }
    
    // TODO: Enforce spec constraint that requires either an href or a template?
    
    this.init(json);
  }
283756
function JSONMinifier() {
  const self = this;
  self.process = ({ output }) => JSON.stringify(JSON.parse(output));
}