Derives v2.1.0 collection info from a v1.0.0 collection object.

@param {Object} collectionV1 - The v1.0.0 collection object to be converted to v2.1.0.
@return {Object} - The compiled v2.x collection info manifest.
180809
function (collectionV1) {
        var info = Builders.super_.prototype.info.call(this, collectionV1);

        info.schema = constants.SCHEMA_V2_1_0_URL;

        return info;
    }
493965
function (collectionIdentity) {
      if (!collectionIdentity) return;
      var schema = connectionObject.collections[collectionIdentity].attributes;
      
      if(!schema)
       return 'id'; 
      
      var key;
      for(key in schema){
        if(schema[key].primaryKey)
          return key;
      }
      return 'id';
    }
978711
def convert_v1_to_v2(
        dict  # type: Dict[str, Any]
    ):
    # type: (...) -> Dict[str, Any]
    
    version = dict['version']
    if version != 1:
        raise ValueError('Version {} not 1'.format(version))

    clk_config = dict['clkConfig']
    k = clk_config['k']
    clk_hash = clk_config['hash']

    def convert_feature(f):
        if 'ignored' in f:
            return f

        hashing = f['hashing']
        weight = hashing.get('weight', 1.0)

        if weight == 0:
            return {
                'identifier': f['identifier'],
                'ignored': True
            }

        x = deepcopy(f)
        hashing = x['hashing']
        if 'weight' in hashing:
            del hashing['weight']

        hashing['k'] = int(round(weight * k))
        hashing['hash'] = clk_hash
        return x

    result = {
        'version': 2,
        'clkConfig': {
            'l': clk_config['l'],
            'xor_folds': clk_config.get('xor_folds', 0),
            'kdf': clk_config['kdf']
        },
        'features': list(map(convert_feature, dict['features']))
    }
    return result
905290
def get_project_collection(self, collection_id):
        
        route_values = {}
        if collection_id is not None:
            route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str')
        response = self._send(http_method='GET',
                              location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf',
                              version='5.1-preview.2',
                              route_values=route_values)
        return self._deserialize('TeamProjectCollection', response)
1323177
public static <E> List<E> buildMergedList(
            Collection<E> collection1, Collection<E> collection2) {
        List<E> mergedList = new ArrayList<>(collection1);
        mergedList.addAll(collection2);
        return mergedList;
    }
28462
function (responseV1) {
        var response = {},
            self = this,
            originalRequest;

        originalRequest = self.savedRequest(responseV1);

        // add ids to the v2 result only if both: the id and retainIds are truthy.
        // this prevents successive exports to v2 from being overwhelmed by id diffs
        self.options.retainIds && (response.id = responseV1.id || util.uid());

        response.name = responseV1.name || 'response';
        response.originalRequest = originalRequest ? self.request(originalRequest) : undefined;
        response.status = responseV1.responseCode && responseV1.responseCode.name || undefined;
        response.code = responseV1.responseCode && responseV1.responseCode.code || undefined;
        response._postman_previewlanguage = responseV1.language;
        response._postman_previewtype = responseV1.previewType;
        response.header = responseV1.headers;
        response.cookie = _.map(responseV1.cookies, function (cookie) {
            return self.cookie(cookie);
        });
        response.responseTime = responseV1.time;
        response.body = responseV1.text;

        return response;
    }
575369
function collections(library) {
  var instance = proxy(library, 'get', 'collections');

  Object.defineProperties(instance, {

    library: {
      value: library
    },

    top: {
      value: proxy(instance, 'get', 'top')
    },

    collections: {
      value: proxy(instance, 'get', '', 'collections')
    },

    nested: {
      get: function () { return this.collections; }
    },

    items: {
      value: proxy(instance, 'get', '', 'items')
    },

    tags: {
      value: proxy(instance, 'get', '', 'tags')
    }
  });

  Object.defineProperty(instance.items, 'top', {
    value: proxy(instance, 'get', '', 'items/top')
  });

  return instance;
}
728626
function(files) {
    var collection = {};
    files.forEach(function(file) {
        var filename = file.name;
        if (!collection.hasOwnProperty(filename) || collection[filename].version < file.version) {
            collection[filename] = file;
        }
    });
    return Object.keys(collection).map(function(name) {
        return collection[name];
    });
}
967382
function svgUrl(name, collection) {
  for (var i = 0, result; i < COLLECTION_FILTERS.length; i++) {
    if (COLLECTION_FILTERS[i][0].test(collection)) {
      result = COLLECTION_FILTERS[i][1];
      collection = _.isFunction(result)? result(collection) : result;
      break;
    }
  }
  return 'https://raw.github.com/fontello/' + collection +
         '/master/src/svg/' + name + '.svg';
}
771895
function getVersionSCXML(machineName, versionKey) {
        let route = getVersionModelRoute(machineName, versionKey);
        return fs.readFileSync(repositoryPath + "/" + route).toString('utf8');
    }
1347314
function collectionLookup (collection, query) {
	const id = createID(query.pattern, query.language);
	log(`collectionLookup: querying for ${id}`);
	return collection.find({_id: id}, {result: 1}).toArray()
		.then(
			(docs) => {
				log(`collectionLookup: Got ${docs.length} docs`);
				if (docs.length === 0) {
					log(`collectionLookup ${createID(query.pattern, query.language)}: no results`);
					return Promise.resolve(PATTERN_UNKNOWN);
				} else if (docs.length === 1) {
					log(`collectionLookup ${query.pattern}-${query.language}: result: ${docs[0].result}`);
					return Promise.resolve(docs[0]);
				} else {
					log(`collectionLookup unexpected multiple match: ${jsonStringify(docs)}`);
					return Promise.resolve(PATTERN_UNKNOWN);
				}
			},
			(e) => {
				log(`collectionLookup error: ${e}`);
				return Promise.resolve(PATTERN_UNKNOWN);
			}
		);
}
945360
function collections(options) {
  options = options || {};

  return function plugin(app, base) {
    if (!isValidInstance(app)) return;

    app.option(base.options);
    app.option(options);

    app.create('badges', { viewType: 'partial' });
    app.create('docs', { viewType: 'partial' });

    app.use(require('generate-collections'));
    return plugin;
  };
}
7198
function toDrupalMajorVersion(version) {
    var regex = /^(\d+)\.\d+\.[x\d+]/;
    var match = version.match(regex)
    if (match) {
      return match[1] + '.x';
    }

    return version;
  }
672510
function (v) {
    if (typeof v === "number")
      return 1;
    if (typeof v === "string")
      return 2;
    if (typeof v === "boolean")
      return 8;
    if (isArray(v))
      return 4;
    if (v === null)
      return 10;
    if (_.isRegExp(v))
      // note that typeof(/x/) === "object"
      return 11;
    if (typeof v === "function")
      return 13;
    if (_.isDate(v))
      return 9;
    if (EJSON.isBinary(v))
      return 5;
    if (v instanceof LocalCollection._ObjectID)
      return 7;
    return 3; // object

    // XXX support some/all of these:
    // 14, symbol
    // 15, javascript code with scope
    // 16, 18: 32-bit/64-bit integer
    // 17, timestamp
    // 255, minkey
    // 127, maxkey
  }
537011
function getFunctionVersions(name, marker) {
    // Grab functions
    return new Promise((resolve, reject) => {
        lambda.listVersionsByFunction({
            FunctionName: name,
            Marker: marker
        }, function(err, data) {
            if (err) return reject(err);

            // Check if we can grab even more
            if (data.NextMarker) {
                return getFunctionVersions(name, data.NextMarker).then((versions) => {
                    resolve(data.Versions.concat(versions));
                });
            }

            resolve(data.Versions);
        });
    });
}
1167709
function getVersionRoute(machineName, versionKey) {
        let manifest = getManifest();

        if (!manifest.machines[machineName]) {
            throw new Error("Machine does not exists");
        }

        if (!manifest.machines[machineName].versions[versionKey]) {
            throw new Error("Version does not exists");
        }

        return manifest.machines[machineName].versions[versionKey].route;
    }
1025833
function() {
      if (!this.cid) {
        this.cid = _.uniqueId('collection');
      }
      return this.constructor.debugName ? this.constructor.debugName + this.cid.replace('collection', '') : this.cid;
    }