get client options from currentProfile or default

@param {object} [options]
@param {string} [options.baseurl]
@param {object} [options.headers]
@returns {object}
352594
function getConfig(options) {
	const profileOptions = {
		baseUrl: get('pod.url'),
		headers: {
			'user-agent': `yodata/client (https://yodata.io)`,
			'x-api-key': get('pod.secret')
		},
		hooks: {
			beforeRequest: [
				logRequest
			],
			afterResponse: [
				parseResponseData
			]
		}
	}
	return defaults(options, profileOptions)
}
479343
def options
      {
        headers: {
          accept: :json,
          content_type: :json,
          accept_encoding: 'gzip ,deflate',
          user_agent: "FreshdeskAPI API #{FreshdeskAPI::VERSION}"
        },
        read_timeout: nil,
        open_timeout: nil,
        base_url: @base_url
      }.merge(client_options)
    end
3697
function getDefaultOpts(simple) {
  'use strict';

  var defaultOptions = {
    omitExtraWLInCodeBlocks: {
      defaultValue: false,
      describe: 'Omit the default extra whiteline added to code blocks',
      type: 'boolean'
    },
    noHeaderId: {
      defaultValue: false,
      describe: 'Turn on/off generated header id',
      type: 'boolean'
    },
    prefixHeaderId: {
      defaultValue: false,
      describe: 'Specify a prefix to generated header ids',
      type: 'string'
    },
    headerLevelStart: {
      defaultValue: false,
      describe: 'The header blocks level start',
      type: 'integer'
    },
    parseImgDimensions: {
      defaultValue: false,
      describe: 'Turn on/off image dimension parsing',
      type: 'boolean'
    },
    simplifiedAutoLink: {
      defaultValue: false,
      describe: 'Turn on/off GFM autolink style',
      type: 'boolean'
    },
    excludeTrailingPunctuationFromURLs: {
      defaultValue: false,
      describe: 'Excludes trailing punctuation from links generated with autoLinking',
      type: 'boolean'
    },
    literalMidWordUnderscores: {
      defaultValue: false,
      describe: 'Parse midword underscores as literal underscores',
      type: 'boolean'
    },
    strikethrough: {
      defaultValue: false,
      describe: 'Turn on/off strikethrough support',
      type: 'boolean'
    },
    tables: {
      defaultValue: false,
      describe: 'Turn on/off tables support',
      type: 'boolean'
    },
    tablesHeaderId: {
      defaultValue: false,
      describe: 'Add an id to table headers',
      type: 'boolean'
    },
    ghCodeBlocks: {
      defaultValue: true,
      describe: 'Turn on/off GFM fenced code blocks support',
      type: 'boolean'
    },
    tasklists: {
      defaultValue: false,
      describe: 'Turn on/off GFM tasklist support',
      type: 'boolean'
    },
    smoothLivePreview: {
      defaultValue: false,
      describe: 'Prevents weird effects in live previews due to incomplete input',
      type: 'boolean'
    },
    smartIndentationFix: {
      defaultValue: false,
      description: 'Tries to smartly fix indentation in es6 strings',
      type: 'boolean'
    },
    disableForced4SpacesIndentedSublists: {
      defaultValue: false,
      description: 'Disables the requirement of indenting nested sublists by 4 spaces',
      type: 'boolean'
    },
    simpleLineBreaks: {
      defaultValue: false,
      description: 'Parses simple line breaks as <br> (GFM Style)',
      type: 'boolean'
    },
    requireSpaceBeforeHeadingText: {
      defaultValue: false,
      description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
      type: 'boolean'
    }
  };
  if (simple === false) {
    return JSON.parse(JSON.stringify(defaultOptions));
  }
  var ret = {};
  for (var opt in defaultOptions) {
    if (defaultOptions.hasOwnProperty(opt)) {
      ret[opt] = defaultOptions[opt].defaultValue;
    }
  }
  return ret;
}
1012831
function loadWithCallback (options, callback) {
  const endpoint = options.endpoint ? URL.parse(options.endpoint) : DEFAULT_URL
  const name = options.name || options.application
  const context = options.context
  const client = endpoint.protocol === 'https:' ? https : http

  client.request({
    protocol: endpoint.protocol,
    hostname: endpoint.hostname,
    port: endpoint.port,
    path: getPath(endpoint.path, name, options.profiles, options.label),
    auth: getAuth(options.auth, endpoint),
    rejectUnauthorized: options.rejectUnauthorized !== false,
    agent: options.agent
  }, (res) => {
    if (res.statusCode !== 200) { // OK
      res.resume() // it consumes response
      return callback(new Error('Invalid response: ' + res.statusCode))
    }
    let response = ''
    res.setEncoding('utf8')
    res.on('data', (data) => {
      response += data
    })
    res.on('end', () => {
      try {
        const body = JSON.parse(response)
        callback(null, new Config(body, context))
      } catch (e) {
        callback(e)
      }
    })
  }).on('error', callback).end()
}
807341
function getOptions (userOptions = {}) {
	let options = _.cloneDeep(userOptions);

	if (options.format === 'html') {
		options.outputAsHtml = true;
		options.verbose = true;
		options.format = 'json';
	}

	return options;
}
229216
public static ClientOptions of(ClientOptions baseOptions, ClientOptionValue<?>... options) {
        // TODO(trustin): Reduce the cost of creating a derived ClientOptions.
        requireNonNull(baseOptions, "baseOptions");
        requireNonNull(options, "options");
        if (options.length == 0) {
            return baseOptions;
        }
        return new ClientOptions(baseOptions, options);
    }
115643
function(connect, options) {
	              return [
	                connect.compress({
	                  level: 9
	                }),
	                function(req, res, next) {
	                  if (req.headers.origin === undefined) {
	                    res.setHeader('Access-Control-Allow-Origin', "*");
	                  } else {
	                    res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
	                  }
	                  res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
	                  console.log(req.method + " on " + req.originalUrl);
	                  if (req.originalUrl.indexOf("/data/")===0) {
	                    res.setHeader('Access-Control-Allow-Headers', 'content-type');
	                    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
	                    res.setHeader('Content-Length', '0');
	                    res.setHeader('Content-Type', 'application/json; charset=utf-8');
	                    datahandler(req,res,"./app/stubs/Unidesk/WebSocket");
	                    res.end();
	                  } else if(req.originalUrl.indexOf("/app/")===0) {
	                      var body = grunt.file.read(options.base+"src/index.html");
	                      res.write(body);
	                      res.end();
	                  } else {
	                    next();
	                  }
	                },
	                connect.static(options.base),
	                function(req, res, next){
	                	if(!(/\/(src|dist)\//).test(req.originalUrl)){
	                      var body = grunt.file.read("src/index.html");
	                      res.write(body);
	                      res.end();
	                	} else {
	                		 next();
	                	}
	                },
	                connect.directory(options.base)
	              ];
	            }
297499
function createDefaultOptions(url) {

  var options = {
      referer                 : DEFAULT_REFERER,
      skipDuplicates          : DEFAULT_SKIP_DUPLICATES,
      maxConnections          : DEFAULT_NUMBER_OF_CONNECTIONS,
      rateLimits              : DEFAULT_RATE_LIMITS,
      externalDomains         : DEFAULT_CRAWL_EXTERNAL_DOMAINS,
      externalHosts           : DEFAULT_CRAWL_EXTERNAL_HOSTS,
      firstExternalLinkOnly   : DEFAULT_FIRST_EXTERNAL_LINK_ONLY,
      scripts                 : DEFAULT_CRAWL_SCRIPTS,
      links                   : DEFAULT_CRAWL_LINKS,
      linkTypes               : DEFAULT_LINKS_TYPES,
      images                  : DEFAULT_CRAWL_IMAGES,
      protocols               : DEFAULT_PROTOCOLS_TO_CRAWL,
      timeout                 : DEFAULT_TIME_OUT,
      retries                 : DEFAULT_RETRIES,
      retryTimeout            : DEFAULT_RETRY_TIMEOUT,
      depthLimit              : DEFAULT_DEPTH_LIMIT,
      followRedirect          : DEFAULT_FOLLOW_301,
      userAgent               : DEFAULT_USER_AGENT,
      domainBlackList         : domainBlackList,
      suffixBlackList         : suffixBlackList,
      retry400                : DEFAULT_RETRY_400,
      isExternal              : false,
      storeModuleName         : DEFAULT_STORE_MODULE,
      queueModuleName         : DEFAULT_QUEUE_MODULE,
      jar                     : DEFAULT_JAR

  };

  if (url) {
    options.url = url;
  }

  return options;

}
21226
function defaults(options) {
  options || (options = {});
  options.apiKey || (options.apiKey = 'YOUR_API_KEY');
  options.host || (options.host = 'cdn.segment.com');
  if (!has.call(options, 'page')) options.page = true;
  if (!has.call(options, 'load')) options.load = true;
  return options;
}
401421
private static function getGuzzleClient($baseUrl, $options = [])
    {
        $guzzleOptions = [];
        if (isset($options[self::PROXY])) {
            $guzzleOptions[self::PROXY] = $options[self::PROXY];
        }
        if (isset($options[self::GUZZLE_OPTIONS])) {
            $guzzleOptions = array_merge($guzzleOptions, $options[self::GUZZLE_OPTIONS]);
        }

        $handlerStack = HandlerStack::create();
        $handlerStack->unshift(Middleware::retry(self::retryDecider(), self::retryDelay()));
        $options = array_merge(['base_uri' => $baseUrl, 'handler' => $handlerStack], $guzzleOptions);

        return new GuzzleClient($options);
    }
687523
function( options ){
			
			var parents = helpers.getParentsPathToSelf(getCurrent().name);
			
			for(var i = 0; i < parents.length; i++){
				
				if( parents[i].name === this.name ){
					return options.fn(this);
				}
			}
			
			return options.inverse(this);
			
		}
232396
function getClientAliases(flapjack, options) {
    options = options || {};
    var aliases = getAliases('client', flapjack);
    return _.extend({}, aliases, options.clientAliases);
}
385929
function doQuery(options) {
            // only User Agent (type = `ua`) clients are available at the moment.
            options.data = extend(options.data, {type: 'ua'});

            return models.Client.findOne(options.data, omit(options, ['data']))
                .then((model) => {
                    if (!model) {
                        return Promise.reject(new common.errors.NotFoundError({
                            message: common.i18n.t('common.api.clients.clientNotFound')
                        }));
                    }

                    return {
                        clients: [model.toJSON(options)]
                    };
                });
        }
484127
function extractHeaders(options) {
    let headers = {};
    if (options && options.headers) {
        headers = options.headers;
        delete options.headers;
    }
    return headers;
}
1313267
function normalizeOptions(options) {
  options = options ? options : {}
  if (!options.headers) {
    options.headers = {}
  }
  if (!options.query) {
    options.query = {}
  }
  if (!options.hasOwnProperty('auth')) {
    options.auth = true
  }
  return options
}
35589
function getDefaultPlugins (options) {
  var scope = Core.scope;
  var customNameFunc = options.generateScopedName;
  var defaultNameFunc = process.env.NODE_ENV === 'production' ?
      generateShortName :
      generateLongName;

  scope.generateScopedName = customNameFunc || defaultNameFunc;

  return [
    Core.values
    , Core.localByDefault
    , Core.extractImports
    , scope
  ];
}
948088
function getPreLoadPage(options, context) {
    var load = options.load;
    if (!load) {
        return;
    }

    if (load === true && options.host) {
        load = [options.host];
    }
    else {
        if (!Array.isArray(load)) {
            load = [load];
        }

        if (_.isString(load[0])) {
            load = context.findFileByPattern(load);
        }
    }
    return load;
}