Provide plugin path for upload into Jira e.g. useful for auto deploy
        :param plugin_path:
        :return:
14041
def upload_plugin(self, plugin_path):
        
        files = {
            'plugin': open(plugin_path, 'rb')
        }
        headers = {
            'X-Atlassian-Token': 'nocheck'
        }
        upm_token = self.request(method='GET', path='rest/plugins/1.0/', headers=headers, trailing=True).headers[
            'upm-token']
        url = 'rest/plugins/1.0/?token={upm_token}'.format(upm_token=upm_token)
        return self.post(url, files=files, headers=headers)
755817
def load(self, path):
        
        self.dct = wrapper.Dictionary()
        self.guide = wrapper.Guide()

        with open(path, 'rb') as f:
            self.dct.read(f)
            self.guide.read(f)

        return self
1346256
def addDesktopResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootDesktopResource.putChild(pluginSubPath, resource)
823286
function (pluginName, env, path) {
    var self = this;
    var context = {
      status: this.status.bind(this),
      out: this.out.bind(this),

      comment: function (text) {
        self.comment(text, pluginName);
      },

      cmd: function (cmd, next) {
        if (typeof(cmd) === 'string' || cmd.command) {
          cmd = {cmd: cmd};
        }

        cmd.env = _.extend({}, env, {
          PATH: getPath(path),
          HOME: process.env.HOME || (process.env.HOMEDRIVE + process.env.HOMEPATH),
          LANG: process.env.LANG,
          SSH_AUTH_SOCK: process.env.SSH_AUTH_SOCK,
          PAAS_NAME: 'strider'
        }, cmd.env || {});

        return self.cmd(cmd, pluginName, next);
      },

      // update pluginData
      data: function (data, method, path) {
        self.status('plugin-data', {
          plugin: pluginName,
          data: data,
          method: method,
          path: path
        });
      },

      dataDir: this.config.dataDir,
      baseDir: this.config.baseDir,
      cacheDir: this.config.cacheDir,
      cachier: this.config.cachier(pluginName),
      io: this.io,

      plugin: pluginName,
      phase: this.phase,
      job: this.job,
      branch: this.job.ref.branch,
      project: this.project,

      runnerId: (
        this.config.branchConfig
        && this.config.branchConfig.runner
        && this.config.branchConfig.runner.id || 'unkown'
      )
    };

    return context;
  }
772994
def upload_to(field_path, default):
    
    from yacms.conf import settings
    for k, v in settings.UPLOAD_TO_HANDLERS.items():
        if k.lower() == field_path.lower():
            return import_dotted_path(v)
    return default
1022497
private void addExtraPluginDependenciesToClasspath(Set<URL> path) throws MojoExecutionException {
        if (extraPluginDependencyArtifactId == null && extendedPluginDependencyArtifactId == null) {
            return;
        }

        try {
            Set<Artifact> artifacts = new HashSet<Artifact>(this.pluginDependencies);
            for (Artifact artifact : artifacts) {
                // must
                if (artifact.getArtifactId().equals(extraPluginDependencyArtifactId)
                    || artifact.getArtifactId().equals(extendedPluginDependencyArtifactId)) {
                    getLog().debug("Adding extra plugin dependency artifact: " + artifact.getArtifactId()
                        + " to classpath");
                    path.add(artifact.getFile().toURI().toURL());

                    // add the transient dependencies of this artifact
                    Set<Artifact> deps = resolveExecutableDependencies(artifact, true);
                    if (deps != null) {
                        for (Artifact dep : deps) {
                            getLog().debug("Adding extra plugin dependency artifact: " + dep.getArtifactId()
                                + " to classpath");
                            path.add(dep.getFile().toURI().toURL());
                        }
                    }
                }
            }
        } catch (MalformedURLException e) {
            throw new MojoExecutionException("Error during setting up classpath", e);
        }
    }
1160349
def hook_path
      @hook_path ||= begin
        plugin_path = File.join(@config.plugin_directory,
                                @context.hook_type_name,
                                "#{Overcommit::Utils.snake_case(@hook_name)}.rb")

        if File.exist?(plugin_path)
          plugin_path
        else
          # Otherwise this is an ad hoc hook using an existing hook script
          hook_config = @config.for_hook(@hook_name, @context.hook_class_name)

          command = Array(hook_config['command'] || hook_config['required_executable'])

          if @config.verify_signatures? &&
            signable_file?(command.first) &&
            !Overcommit::GitRepo.tracked?(command.first)
            raise Overcommit::Exceptions::InvalidHookDefinition,
                  'Hook specified a `required_executable` or `command` that ' \
                  'is a path relative to the root of the repository, and so ' \
                  'must be tracked by Git in order to be signed'
          end

          File.join(Overcommit::Utils.repo_root, command.first.to_s)
        end
      end
    end
168347
def load_manifest(self, path):
        
        manifest_path = os.path.join(path, "plugin.json")
        self._logger.debug("Attempting to load plugin manifest from {}.".format(manifest_path))
        try:
            with open(manifest_path) as f:
                manifest = json.load(f)
            manifest["path"] = path
            self._manifests.append(manifest)
            self._logger.debug("Loaded plugin manifest from {}.".format(manifest_path))
        except ValueError:
            self._logger.error("Failed to decode plugin manifest at {}.".format(manifest_path))
        except (OSError, IOError) as e:
            self._logger.error("Failed to load plugin manifest at {}.".format(manifest_path))
1139112
public ElasticsearchContainer withPluginDir(Path pluginDir) {
        if (pluginDir == null) {
            return this;
        }

        // When we have a plugin dir, we need to mount it in the docker instance
        this.pluginDir = createVolumeDirectory(true);

        // We create the volume that will be needed for plugins
        addFileSystemBind(this.pluginDir.toString(), "/plugins", BindMode.READ_ONLY);

        logger().debug("Installing plugins from [{}]", pluginDir);
        try {
            Files.list(pluginDir).forEach(path -> {
                logger().trace("File found in [{}]: [{}]", pluginDir, path);
                if (path.toString().endsWith(".zip")) {
                    logger().debug("Copying [{}] to [{}]", path.getFileName(), this.pluginDir.toAbsolutePath().toString());
                    try {
                        Files.copy(path, this.pluginDir.resolve(path.getFileName()));
                        withPlugin("file:///tmp/plugins/" + path.getFileName());
                    } catch (IOException e) {
                        logger().error("Error while copying", e);
                    }
                }
            });
        } catch (IOException e) {
            logger().error("Error listing plugins", e);
        }
        return this;
    }
901907
def deploy_file(file_path, bucket):
    

    # Paths look like:
    #  index.html
    #  css/bootstrap.min.css

    logger.info("Deploying {0}".format(file_path))

    # Upload the actual file to file_path
    k = Key(bucket)
    k.key = file_path
    try:
        k.set_contents_from_filename(file_path)
        k.set_acl('public-read')
    except socket.error:
        logger.warning("Caught socket.error while trying to upload {0}".format(
            file_path))
        msg = "Please file an issue with alotofeffort if you see this,"
        logger.warning(msg)
        logger.warning("providing as much info as you can.")
990729
def load_plugin(plugin_name):
    
    plugin_cls = plugin_map.get(plugin_name, None)
    if not plugin_cls:
        try:
            plugin_module_name, plugin_cls_name = plugin_name.split(":")
            plugin_module = import_module(plugin_module_name)
            plugin_cls = getattr(plugin_module, plugin_cls_name)
        except ValueError:
            raise click.ClickException(
                '"{}" is not a valid plugin path'.format(plugin_name)
            )
        except ImportError:
            raise click.ClickException(
                '"{}" does not name a Python module'.format(
                    plugin_module_name
                )
            )
        except AttributeError:
            raise click.ClickException(
                'Module "{}" does not contain the class "{}"'.format(
                    plugin_module_name, plugin_cls_name
                )
            )
    return plugin_cls
528282
def path(self, which=None):
        
        base = urljoin(
            self._server_config.url + '/',
            self._meta['api_path']  # pylint:disable=no-member
        )
        if (which == 'self' or which is None) and hasattr(self, 'upload_id'):
            # pylint:disable=E1101
            return urljoin(base + '/', str(self.upload_id))
        return super(ContentUpload, self).path(which)
1037903
def file_upload(context, id, path):
    
    result = component.file_upload(context, id=id, file_path=path)
    utils.format_output(result, context.format)
337175
def param_upload(field, path):
    
    if not path:
        return None
    param = {}
    param['field'] = field
    param['path'] = path
    return param
165003
def upload(path, token, folder):
    
    config = _load_config(CFG_FILE)
    token = _resolve_input(token, 'token', 'token', config)
    folder = _resolve_input(folder, 'folder', 'prod_folder', config)

    update_databricks(
        logger,
        path,
        token,
        folder,
        update_jobs=False,
        cleanup=False
    )
128691
def upload_file(self, file_name, file_path):
        
        upload_key = Key(bucket=self.bucket, name=file_name)
        content_type = "text/plain"
        if file_name.endswith(".html"):
            content_type = "text/html"
        elif file_name.endswith(".jpg"):
            content_type = "image/jpeg"
        elif file_name.endswith(".png"):
            content_type = "image/png"
        upload_key.set_contents_from_filename(
            file_path,
            headers={"Content-Type": content_type})
        upload_key.url = \
            upload_key.generate_url(expires_in=3600).split("?")[0]
        try:
            upload_key.make_public()
        except Exception:
            pass
115253
def _find_plugin_dir(module_type):
    ''''''

    for install_dir in _get_plugin_install_dirs():
        candidate = os.path.join(install_dir, module_type)
        if os.path.isdir(candidate):
            return candidate
    else:
        raise PluginCandidateError(
            'No plugin found for `{}` module in paths:\n{}'.format(
                module_type, '\n'.join(_get_plugin_install_dirs())))