create new Context
 @param directory [String] directory to use as a base for finding partials
 @param data [Hash]
 include another latex file into the current template
764422
def partial( template, data={} )
            context = self.class.new( @directory, data )
            ErbLatex::File.evaluate(Pathname.new(template), context.getBinding, @directory)
        end
815806
function _createContext(context) {
  let newContext = context || _defaultContext
  if (_isString(newContext) || _isArray(newContext)) {
    newContext = {
      any: _arrayify(newContext),
    }
  } else {
    newContext = _arrayizeContext(context)
  }
  return newContext
}
533553
public File createFile(File dir, String filename) throws DataUtilException {
        if(dir == null) {
            throw new DataUtilException("The directory parameter can't be a null value");
        }
        try {
            File file = new File(dir, filename);
            return createFile(file);
        } catch (Exception e) {
            throw new DataUtilException("Invalid file: " + filename);
        }
    }
502073
def step_use_curdir_as_working_directory(context):
    
    context.workdir = os.path.abspath(".")
    command_util.ensure_workdir_exists(context)
960906
private static File createReserveDiskCacheDir(Context context) {
		File cacheDir = StorageUtils.getCacheDirectory(context, false);
		File individualDir = new File(cacheDir, "uil-images");
		if (individualDir.exists() || individualDir.mkdir()) {
			cacheDir = individualDir;
		}
		return cacheDir;
	}
714065
protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
    if (0 == webServer.getHandlers().length) {
      throw new RuntimeException("Couldn't find handler");
    }
    WebAppContext webAppCtx = new WebAppContext();
    webAppCtx.setContextPath(pathSpec);
    webAppCtx.setWar(dir);
    addContext(webAppCtx, true);
  }
737197
public void makeDir(String dir, String data) {

        try {

            boolean deafult_path_exist = store.exists(dir);
            if (!deafult_path_exist) {
                LOGGER.info("create: " + dir);
                this.writePersistentUrl(dir, data);
            } else {
            }

        } catch (KeeperException e) {

            LOGGER.error("cannot create path: " + dir, e);

        } catch (Exception e) {

            LOGGER.error("cannot create path: " + dir, e);
        }
    }
491769
def append(self, context, data):
        
        return ContextStack(self._contexts + [context], self._data + [data])
1248590
def data_context_name(fn):
    
    return os.path.join(os.path.dirname(__file__), "template_data", fn)
1117701
function (data) {
      var include = function (path, includeData) {
        var d = utils.shallowCopy({}, data);
        if (includeData) {
          d = utils.shallowCopy(d, includeData);
        }
        return includeFile(path, opts)(d);
      };
      return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]);
    }
1289274
def set_data(new_data, mode)
      raise ArgumentError, "Data can't be set unless mode is :command or :merge" unless %i[command merge].include? mode
      raise ArgumentError, 'Data must be a hash when in merge mode' if mode == :merge && !new_data.is_a?(Hash)

      validate_rows new_data if mode == :command

      @data = new_data.dup
    end
941337
def load_directory!(dir)
      paths = Dir.glob(dir).grep LeMeme::IMAGE_EXTENSIONS
      @memes.merge!(paths.reduce({}) do |images, path|
        path = File.expand_path(path)
        name = path.split.last.sub(LeMeme::IMAGE_EXTENSIONS, '').to_s
        images.merge(name => path)
      end)
    end
16239
def create_data_dir():
    
    from django_productline.context import PRODUCT_CONTEXT
    if not os.path.exists(PRODUCT_CONTEXT.DATA_DIR):
        os.mkdir(PRODUCT_CONTEXT.DATA_DIR)
        print('*** Created DATA_DIR in %s' % PRODUCT_CONTEXT.DATA_DIR)
    else:
        print('...DATA_DIR already exists.')
188254
public static String createCDataSection(String content, TestContext context) {
        return new CreateCDataSectionFunction().execute(Collections.singletonList(content), context);
    }
1040217
def create_website(directory, template_filename)
      template = File.read(template_filename)
      File.open(html_file(directory, website.title), 'w') do |f|
        f.puts website.to_html(template)
      end 
    end
283327
function do_create_context(context) {
		var context = context || {};
		
		if(!context.replace) {
			context.replace = (function(chunk, context, bodies, params) {
					return chunk.tap(function(data) {
						return (params.from && params.to && (data === params.from) ) ? params.to : data;
					}).render(bodies.block, context).untap();
				});
		}
		
		if(!context.toFixed) {
			context.toFixed = (function(chunk, context, bodies, params) {
					return chunk.tap(function(data) {
						return parseFloat(data).toFixed(params.x || 0);
					}).render(bodies.block, context).untap();
				}); // end of context
		}
		
		return context;
	}
710933
public File createDir(File dir) throws DataUtilException {
        if(dir == null) {
            throw new DataUtilException("Dir parameter can not be a null value");
        }
        if(dir.exists()) {
            throw new DataUtilException("Directory already exists: " + dir.getAbsolutePath());
        }
        if(! dir.mkdir()) {
            throw new DataUtilException("The result of File.mkDir() was false. Failed to create directory. : "
                    + dir.getAbsolutePath());
        }
        trackedFiles.add(dir);
        return dir;
    }