Set up the sub resources using shared @client object
164246
def set_up
      @start = Hoiio::IVRBlock::Start.new @client
      @middle = Hoiio::IVRBlock::Middle.new @client
      @end = Hoiio::IVRBlock::End.new @client
    end
215222
function() {

			// skip loading includes once already loaded
			if (this._bIncludesLoaded) {
				return;
			}

			var mResources = this.getEntry("/sap.ui5/resources");

			if (!mResources) {
				return;
			}

			var sComponentName = this.getComponentName();

			// load JS files
			var aJSResources = mResources["js"];
			if (aJSResources) {
				for (var i = 0; i < aJSResources.length; i++) {
					var oJSResource = aJSResources[i];
					var sFile = oJSResource.uri;
					if (sFile) {
						// load javascript file
						var m = sFile.match(/\.js$/i);
						if (m) {
							//var sJsUrl = this.resolveUri(sFile.slice(0, m.index));
							var sJsUrl = sComponentName.replace(/\./g, '/') + (sFile.slice(0, 1) === '/' ? '' : '/') + sFile.slice(0, m.index);
							Log.info("Component \"" + sComponentName + "\" is loading JS: \"" + sJsUrl + "\"");
							// call internal sap.ui.require variant that accepts a requireJS path and loads the module synchronously
							sap.ui.requireSync(sJsUrl);
						}
					}
				}
			}

			// include CSS files
			var aCSSResources = mResources["css"];
			if (aCSSResources) {
				for (var j = 0; j < aCSSResources.length; j++) {
					var oCSSResource = aCSSResources[j];
					if (oCSSResource.uri) {
						var sCssUrl = this.resolveUri(oCSSResource.uri);
						Log.info("Component \"" + sComponentName + "\" is loading CSS: \"" + sCssUrl + "\"");
						includeStylesheet(sCssUrl, {
							id: oCSSResource.id,
							"data-sap-ui-manifest-uid": this._uid
						});
					}
				}
			}

			this._bIncludesLoaded = true;

		}
1308614
def load_resource(options = {})

      # Determine the name based on the current controller if not specified.
      resource_name = options[:name] || controller_name.singularize

      # Determine the class based on the resource name if not provided.
      # FIXME: Do not hard code engine name 
      resource_class = options[:class] || "Hicube::#{resource_name.singularize.camelize}".classify.constantize

      resource = if resource_class == Hicube::Account
        # resource = Hicube::Account.first
        current_account
      else
        # resource = resource_class.unscoped.find(params[:id])
        resource_class.unscoped.where(account: current_account).find(params[:id])
      end
      # # Confirm current user has permission to view resource.
      # unless resource.account == current_account
      #   # TODO: log an audit event.

      #   # SECURITY RISK: The user should not be able to distinguish between a
      #   # non-existant resource and another user's resource. This way you can't
      #   # probe to the system and determine another account's data.
      #   raise Mongoid::Errors::DocumentNotFound.new(resource_class, :id => params[:id])
      # end

      # Set an instance variable @resource_name to the resource.
      instance_variable_set("@#{resource_name}", resource)

      rescue Mongoid::Errors::DocumentNotFound => e
      notify :error, ::I18n.t('messages.resource.not_found',
        :type     => resource_class.model_name.human,
        :criteria => resource_class.human_attribute_name(:id),
        :value    => params[:id]
      )
      redirect_to :action => :index
    end
702373
def create_container
      name = @view.titleize.gsub(/ /, '')
      file = "client/containers/#{name}.js"
      copy_file "boilerplate/views/ContainerTemplate.js", file
      gsub_file file, /Placeholder/, name
    end
492579
function (host, done_cb, secure) {
    // Initializes the object that stores subscriptions
    this.subscriptions = {};
    // Initializes the object that holds the internal client
    this.client = {};
    // Functions backlog
    this.backlog = [];
    // Connect
    this.client = connectBrowser(this.subscriptions, this.backlog, host, done_cb, secure);
}
501824
@Override
    public void populateClientProperties(Client client, Map<String, Object> properties)
    {
        setConfig(properties);
        for (String key : properties.keySet())
        {
            Object value = properties.get(key);
            if (key.equals(PersistenceProperties.KUNDERA_BATCH_SIZE) && value instanceof Integer)
            {
                Integer batchSize = (Integer) value;
                ((RedisClient) client).setBatchSize(batchSize);
            }
        }
    }
574494
def bind_client(self, new):
        """"""
        top = self._stack[-1]
        self._stack[-1] = (new, top[1])
825331
function setClient() {
		var client = arguments[ 0 ],
			queries = Array.prototype.slice.apply( arguments );

		client.start( start )
			.end( end )
			.ms( ms )
			.arrays( arrays )
			.tsuids( tsuids )
			.annotations( annotations );

		queries.shift();
			
		client.queries.apply( client, queries );
	}
25324
void loadClient(String persistenceUnit, Client client)
    {
        if (!clientMap.containsKey(persistenceUnit) && client != null)
        {
            clientMap.put(persistenceUnit, client);
        }
    }
127280
def load_resource(options = {})

      # Determine the name based on the current controller if not specified.
      resource_name = options[:name] || controller_name.singularize

      # Determine the class based on the resource name if not provided.
      # FIXME: Do not hard code engine name 
      resource_class = options[:class] || "Hicube::#{resource_name.singularize.camelize}".classify.constantize
      # resource = resource_class.unscoped.find((params.has_key?(:id) ? params[:id] : 'index'))
      resource = if params.has_key?(:id)
        current_account.pages.unscoped.find(params[:id])
      else
        current_account.pages.unscoped.first
      end


      # # Confirm current user has permission to view resource.
      # unless resource.account == current_account
      #   # TODO: log an audit event.

      #   # SECURITY RISK: The user should not be able to distinguish between a
      #   # non-existant resource and another user's resource. This way you can't
      #   # probe to the system and determine another account's data.
      #   raise Mongoid::Errors::DocumentNotFound.new(resource_class, :id => params[:id])
      # end

      # Set an instance variable @resource_name to the resource.
      instance_variable_set("@#{resource_name}", resource)

      rescue Mongoid::Errors::DocumentNotFound => e
      notify :error, ::I18n.t('messages.resource.not_found',
        :type     => resource_class.model_name.human,
        :criteria => resource_class.human_attribute_name(:id),
        :value    => params[:id]
      )
      redirect_to '/404.html'
    end
67452
def rc_setup client, options={}
      rc_options_ctl(client).merge!(
        rc_options_extract(client.members, options, :reject))

      rc_options_new(client).merge!(
        rc_options_extract(client.members, options, :select))
    end
727730
@Override
    public void onXml(ClientProperties cp)
    {
        hsmd.onInitialize();
        if (cp != null)
        {
            hsmd.setClientProperties(cp);
        }
    }
445587
public List<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) {

        if (subjs == null || subjs.size() == 0) {
            return Collections.singletonList(new Subject(new ArrayList<Attribute>()));
        }

        List<Subject> subjects = new ArrayList<Subject>(subjs.size());
        // Go through each of the subjects
        for (Map<URI, List<AttributeValue>> s : subjs) {
            List<Attribute> attributes = new ArrayList<Attribute>();

            // Extract and create the attributes for this subject and add them
            // to the set
            for (URI uri : s.keySet()) {
                List<AttributeValue> attributeValues = s.get(uri);
                if (attributeValues != null && attributeValues.size() > 0) {
                    attributes.add(
                        new BasicAttribute(uri, attributeValues.get(0).getType(),
                            null, null, attributeValues));
                }
            }

            // Create a new subject and add the attributes for this subject
            subjects.add(new Subject(attributes));
        }

        return subjects;
    }
1093805
def init(*args, **kwargs):
    
    global _initial_client
    client = Client(*args, **kwargs)
    Hub.current.bind_client(client)
    rv = _InitGuard(client)
    if client is not None:
        _initial_client = weakref.ref(client)
    return rv
1059190
def load
      resp = @client.describe_tags(filters: [
        {
          name: "key",
          values: [@key]
        },
        {
          name: "value",
          values: [@value]
        }
      ])
      @data = resp.tags[0]
      self
    end
1287071
protected static void setupDataSourceProviders(){
		List<String> providerProperties = new LinkedList<String>();
		for (Object key: configuration.keySet()){
			String keyName = (String)key;
			if (keyName.startsWith(PROVIDER_PROPERTY_NAME)){
				providerProperties.add(keyName);
			}
		}
		
		dataSourceProviders = new HashMap<String, DataSourceProvider>();
		for (String keyName: providerProperties){
			String providerName = keyName.substring(PROVIDER_PROPERTY_NAME.length(), keyName.length());
			String providerClassName = configuration.getProperty(keyName);
			configuration.remove(keyName);
			DataSourceProvider dsp = null;
			try {
				dsp = (DataSourceProvider)Class.forName(providerClassName).newInstance();
				dataSourceProviders.put(providerName, dsp);
			} catch (Throwable t) {
				if (t instanceof NoClassDefFoundError){
					log.debug("DataSourceProvider not initialized for '" + providerName + "' because the provider class was not found: " + t.getMessage());
				}else{
					log.error("Cannot instantiate DataSourceProvider for '" + providerName + "': " + providerClassName, t);
				}
			}
		}
	}
1260786
function setClientInfo(req) {

	let client = req.client = {};

	initUserAgendAndOS(req.headers, client);
	initClientIp(req, client);
}