/*
helpers_get_dir()

Helper function taken from ACF 4.x to allow finding of asset paths when plugin is included from outside the plugins directory
177292
function helpers_get_dir( $file ) {
		
		$dir = trailingslashit( dirname( $file ) );
		$count = 0;

		// sanitize for Win32 installs
		$dir = str_replace('\\' ,'/', $dir); 
		
		// if file is in plugins folder
		$wp_plugin_dir = str_replace( '\\' ,'/', WP_PLUGIN_DIR ); 
		$dir = str_replace( $wp_plugin_dir, plugins_url(), $dir, $count );

		if ( $count < 1 ) {
			// if file is in wp-content folder
			$wp_content_dir = str_replace( '\\' ,'/', WP_CONTENT_DIR ); 
			$dir = str_replace( $wp_content_dir, content_url(), $dir, $count );
		}

		if ( $count < 1 ) {
			// if file is in ??? folder
			$wp_dir = str_replace( '\\' ,'/', ABSPATH ); 
			$dir = str_replace( $wp_dir, site_url( '/' ), $dir );
		}
		
		return $dir;
	}
582831
def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
    '''
    
    '''
    (path, dest) = _render_filenames(path, dest, saltenv, template, **kwargs)

    return _client().get_dir(path, dest, saltenv, gzip)
1004667
function plugin() {
  return function(style){
    style.include(__dirname);

    if (Canvas) {
      style.define('has-canvas', nodes.true);

      // gradients
      style.define('create-gradient-image', gradient.create);
      style.define('gradient-data-uri', gradient.dataURL);
      style.define('add-color-stop', gradient.addColorStop);

      // color images
      style.define('create-color-image', colorImage.create);
      style.define('color-data-uri', colorImage.dataURL);
    } else {
      style.define('has-canvas', nodes.false);
    }
  };
}
527471
function getBowerFolder() {
    var bowerRC = getBowerRC();
    if (bowerRC === null || bowerRC.directory === undefined) {
        return 'bower_components';
    }

    return bowerRC.directory;
}
446285
protected function resolveAssets(): ?string
    {
        $module = $this->getModuleInfo();
        if (!isset($module['assets'])) {
            return null;
        }
        $directory = $this->directory() . DIRECTORY_SEPARATOR . trim($module['assets'], DIRECTORY_SEPARATOR);
        return is_dir($directory) ? realpath($directory) : null;
    }
755557
public static function getPluginsDirectories()
    {
        $dirs = array(self::getPluginsDirectory());

        if (!empty($GLOBALS['MATOMO_PLUGIN_DIRS'])) {
            $extraDirs = array_map(function ($dir) {
                return rtrim($dir['pluginsPathAbsolute'], '/') . '/';
            }, $GLOBALS['MATOMO_PLUGIN_DIRS']);
            $dirs = array_merge($dirs, $extraDirs);
        }

        return $dirs;
    }
352872
function getDemoFilePath() {
			if (!o.htmlDemo) return null;
			var name = o.htmlDemoFilename || o.fontBaseName;
			return path.join(o.destHtml, name + '.html');
		}
1247543
def _get_plugin_install_dirs():
    ''''''
    builtins_dir = os.path.join(compat.MODULE_ROOT, 'resources', 'plugins')
    if os.name == 'nt':
        # Windows
        local_data_dir = os.path.expandvars('%LOCALAPPDATA%')
        program_files_dir = os.path.expandvars('%PROGRAMFILES%')
        return (
            os.path.join(local_data_dir, 'peru', 'plugins'),
            os.path.join(program_files_dir, 'peru', 'plugins'),
            builtins_dir,
        )
    else:
        # non-Windows
        default_config_dir = os.path.expanduser('~/.config')
        config_dir = os.environ.get('XDG_CONFIG_HOME', default_config_dir)
        return (
            os.path.join(config_dir, 'peru', 'plugins'),
            '/usr/local/lib/peru/plugins',
            '/usr/lib/peru/plugins',
            builtins_dir,
        )
1012380
function absolutizePaths(
  config /*: stylelint$config*/,
  configDir /*: string*/
) /*: stylelint$config*/ {
  if (config.ignoreFiles) {
    config.ignoreFiles = [].concat(config.ignoreFiles).map(glob => {
      if (path.isAbsolute(glob.replace(/^!/, ""))) return glob;

      return globjoin(configDir, glob);
    });
  }

  if (config.plugins) {
    config.plugins = [].concat(config.plugins).map(lookup => {
      return getModulePath(configDir, lookup);
    });
  }

  if (config.processors) {
    config.processors = absolutizeProcessors(config.processors, configDir);
  }

  return config;
}
643996
public function get_asset_url( $file ) {
		if ( $this->get_wp_filesystem()->is_file( $file ) ) {
			$file = str_replace( plugin_dir_path( $this->plugin_file ), '', $file );
		}

		return plugins_url( $file, $this->plugin_file );
	}
880283
public static function getAssetFilePaths($type)
    {
        $path = sprintf('%s/assets/%s/', __DIR__, $type);
        $filenames = preg_grep('/^[^\.]/', scandir($path));
        if (!Arr::iterable($filenames)) {
            return array();
        }

        return array_map(function ($filename) use ($path) {
            return $path.$filename;
        }, $filenames);
    }
956640
function getDirectoriesInURL()
{
	var trail = document.location.pathname.split( PATH_SEPARATOR );

	// check whether last section is a file or a directory
	var lastcrumb = trail[trail.length-1];
	for( var i = 0; i < FILE_EXTENSIONS.length; i++ )
	{
		if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) )
		{
			// it is, remove it and send results
			return trail.slice( 1, trail.length-1 );
		}
	}

	// it's not; send the trail unmodified
	return trail.slice( 1, trail.length );
}
408575
public static function get_plugin_directory($plugintype, $pluginname) {
        if (empty($pluginname)) {
            // Invalid plugin name, sorry.
            return null;
        }

        self::init();

        if (!isset(self::$plugins[$plugintype][$pluginname])) {
            return null;
        }
        return self::$plugins[$plugintype][$pluginname];
    }
949360
function getPaths (settings) {
  return settings.paths.controllers
    .filter(obj => obj.enabled)
    .map(obj => obj.path)
    .concat(settings.paths.assets)
    .concat(settings.paths.views)
    .concat(settings.livereload.paths)
    .sort()
}
202830
function resolvePluginPath(config, file, mdirs) {
  if (_lodash2.default.size(config.plugins)) {
    config.plugins = _lodash2.default.reduce(config.plugins, (res, p, k) => {
      if (!_path2.default.isAbsolute(p)) {
        if (p[0] === '.') {
          p = _path2.default.join(file, p);
        } else {
          for (let dir of mdirs) {
            p = _path2.default.join(dir, p);
            if ((0, _utils.isDirectory)(p)) {
              break;
            }
          }
        }
      }
      res[k] = p;
      return res;
    }, {});
  }
}
730387
function getSubdir() {
    // Parse local path location
    var localPath = url.parse(config.get('url')).path,
        subdir;

    // Remove trailing slash
    if (localPath !== '/') {
        localPath = localPath.replace(/\/$/, '');
    }

    subdir = localPath === '/' ? '' : localPath;
    return subdir;
}
140774
private function get_plugin_files( $path ) {
		$folder = dirname( $this->get_absolute_path( $path ) );

		// Return single file plugins immediately, to avoid iterating over the
		// entire plugins folder.
		if ( WP_PLUGIN_DIR === $folder ) {
			return (array) $path;
		}

		return $this->get_files( trailingslashit( $folder ) );
	}