The egg that the provided path points to will be uploaded to Databricks.
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
    )
1217360
def set(self, path, data):
        
        return self._zk.set(self.__path(path), data)
321468
def _get_path(dataset_name):
  """"""
  path = _checksum_paths().get(dataset_name, None)
  if path:
    return path
  msg = ('No checksums file could be find for dataset %s. Please create one in '
         'one of: %s') % (dataset_name, ', '.join(_CHECKSUM_DIRS))
  raise AssertionError(msg)
545394
def add_pyspark_path():
    

    try:
        spark_home = os.environ['SPARK_HOME']

        sys.path.append(os.path.join(spark_home, 'python'))
        py4j_src_zip = glob(os.path.join(spark_home, 'python',
                                         'lib', 'py4j-*-src.zip'))
        if len(py4j_src_zip) == 0:
            raise ValueError('py4j source archive not found in %s'
                             % os.path.join(spark_home, 'python', 'lib'))
        else:
            py4j_src_zip = sorted(py4j_src_zip)[::-1]
            sys.path.append(py4j_src_zip[0])
    except KeyError:
        logging.error("""SPARK_HOME was not set. please set it. e.g.
          SPARK_HOME='/home/...' ./bin/pyspark [program]""")
        exit(-1)
    except ValueError as e:
        logging.error(str(e))
        exit(-1)
543936
def set_dataset_path(path, cache=None, cachefile="~/.io3d_cache.yaml"):
    
    if cachefile is not None:
        cache = cachef.CacheFile(cachefile)
    cache.update("local_dataset_dir", path)
999191
def data_file(self):
        
        return os.path.join(self.upload_directory, self.properties[datastore.PROPERTY_FILENAME])
863802
public void insertPath(int pathIndex, MultiPathImpl src, int srcPathIndex,
			boolean bForward) {
		if (src == this)
			throw new IllegalArgumentException();

		if (srcPathIndex >= src.getPathCount())
			throw new IllegalArgumentException();

		int oldPathCount = getPathCount();
		if (pathIndex > oldPathCount)
			throw new IllegalArgumentException();

		if (pathIndex < 0)
			pathIndex = oldPathCount;

		if (srcPathIndex < 0)
			srcPathIndex = src.getPathCount() - 1;

		m_bPathStarted = false;

		mergeVertexDescription(src.m_description);// merge attributes from the
													// source

		src._verifyAllStreams();// the source need to be correct.

		int srcPathIndexStart = src.getPathStart(srcPathIndex);
		int srcPathSize = src.getPathSize(srcPathIndex);
		int oldPointCount = m_pointCount;
		int offset = src.isClosedPath(srcPathIndex) && !bForward ? 1 : 0;

		_resizeImpl(m_pointCount + srcPathSize);
		_verifyAllStreams();
		int pathIndexStart = pathIndex < oldPathCount ? getPathStart(pathIndex)
				: oldPointCount;

		// Copy all attribute values.
		for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {
			int semantics = m_description._getSemanticsImpl(iattr);
			int isrcAttr = src.m_description.getAttributeIndex(semantics);

			int comp = VertexDescription.getComponentCount(semantics);

			if (isrcAttr >= 0 && src.m_vertexAttributes[isrcAttr] != null) {
				if (offset != 0)
					m_vertexAttributes[iattr].insertRange(
							pathIndexStart * comp,
							src.m_vertexAttributes[isrcAttr], comp
									* srcPathIndexStart, comp, true, comp, comp
									* oldPointCount);
				m_vertexAttributes[iattr].insertRange((pathIndexStart + offset)
						* comp, src.m_vertexAttributes[isrcAttr], comp
						* (srcPathIndexStart + offset), comp
						* (srcPathSize - offset), bForward, comp, comp
						* (oldPointCount + offset));
			} else {
				// Need to make room for the attributes, so we copy default
				// values in

				double v = VertexDescription.getDefaultValue(semantics);
				m_vertexAttributes[iattr].insertRange(pathIndexStart * comp, v,
						comp * srcPathSize, comp * oldPointCount);
			}
		}

		int newPointCount = oldPointCount + srcPathSize;
		m_paths.add(newPointCount);

		for (int ipath = oldPathCount; ipath >= pathIndex + 1; ipath--) {
			int iend = m_paths.read(ipath - 1);
			m_paths.write(ipath, iend + srcPathSize);
		}

		// ========================== todo: NonLinearSegments =================
		if (src.hasNonLinearSegments(srcPathIndex)) {

		}

		m_pathFlags.add((byte) 0);

		// _ASSERT(m_pathFlags.size() == m_paths.size());

		for (int ipath = oldPathCount - 1; ipath >= pathIndex + 1; ipath--) {
			byte flags = m_pathFlags.read(ipath);
			flags &= ~(byte) PathFlags.enumCalcMask;// remove calculated flags
			m_pathFlags.write(ipath + 1, flags);
		}

		AttributeStreamOfInt8 srcPathFlags = src.getPathFlagsStreamRef();
		byte flags = srcPathFlags.read(srcPathIndex);
		flags &= ~(byte) PathFlags.enumCalcMask;// remove calculated flags

		if (m_bPolygon)
			flags |= (byte) PathFlags.enumClosed;

		m_pathFlags.write(pathIndex, flags);
	}
478139
def save(self, sc, path):
        
        java_model = sc._jvm.org.apache.spark.mllib.classification.SVMModel(
            _py2java(sc, self._coeff), self.intercept)
        java_model.save(sc._jsc.sc(), path)
1281716
def fixup_pth_and_egg_link(home_dir, sys_path=None):
    """"""
    home_dir = os.path.normcase(os.path.abspath(home_dir))
    if sys_path is None:
        sys_path = sys.path
    for path in sys_path:
        if not path:
            path = '.'
        if not os.path.isdir(path):
            continue
        path = os.path.normcase(os.path.abspath(path))
        if not path.startswith(home_dir):
            logger.debug('Skipping system (non-environment) directory %s' % path)
            continue
        for filename in os.listdir(path):
            filename = os.path.join(path, filename)
            if filename.endswith('.pth'):
                if not os.access(filename, os.W_OK):
                    logger.warn('Cannot write .pth file %s, skipping' % filename)
                else:
                    fixup_pth_file(filename)
            if filename.endswith('.egg-link'):
                if not os.access(filename, os.W_OK):
                    logger.warn('Cannot write .egg-link file %s, skipping' % filename)
                else:
                    fixup_egg_link(filename)
619544
def example_path(cls, project, dataset, annotated_dataset, example):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/datasets/{dataset}/annotatedDatasets/{annotated_dataset}/examples/{example}",
            project=project,
            dataset=dataset,
            annotated_dataset=annotated_dataset,
            example=example,
        )
946734
def to_dataset_files(self, local_path=None, remote_path=None):
        
        return FrameToGMQL.to_dataset_files(self, path_local=local_path, path_remote=remote_path)
608069
def fetch_build_egg(self, req):
        """"""
        from setuptools.command.easy_install import easy_install
        dist = self.__class__({'script_args': ['easy_install']})
        opts = dist.get_option_dict('easy_install')
        opts.clear()
        opts.update(
            (k, v)
            for k, v in self.get_option_dict('easy_install').items()
            if k in (
                # don't use any other settings
                'find_links', 'site_dirs', 'index_url',
                'optimize', 'site_dirs', 'allow_hosts',
            ))
        if self.dependency_links:
            links = self.dependency_links[:]
            if 'find_links' in opts:
                links = opts['find_links'][1] + links
            opts['find_links'] = ('setup', links)
        install_dir = self.get_egg_cache_dir()
        cmd = easy_install(
            dist, args=["x"], install_dir=install_dir,
            exclude_scripts=True,
            always_copy=False, build_directory=None, editable=False,
            upgrade=False, multi_version=True, no_report=True, user=False
        )
        cmd.ensure_finalized()
        return cmd.easy_install(req)
1021283
def install(self, new_egg, new_egg_gpg_sig):
        

        # make sure a valid egg was provided
        if not new_egg:
            the_message = 'Must provide a valid Core installation path.'
            logger.debug(the_message)
            return {'success': False, 'message': the_message}

        # if running in gpg mode, check for valid sig
        if self.config.gpg and new_egg_gpg_sig is None:
            the_message = "Must provide a valid Core GPG installation path."
            logger.debug(the_message)
            return {'success': False, 'message': the_message}

        # debug
        logger.debug("Installing the new Core %s", new_egg)
        if self.config.gpg:
            logger.debug("Installing the new Core GPG Sig %s", new_egg_gpg_sig)

        # Make sure /var/lib/insights exists
        try:
            if not os.path.isdir(constants.insights_core_lib_dir):
                logger.debug("Creating directory %s for the Core." %
                             (constants.insights_core_lib_dir))
                os.mkdir(constants.insights_core_lib_dir)
        except OSError:
            logger.info("There was an error creating %s for core installation." % (
                constants.insights_core_lib_dir))
            raise

        # Copy the NEW (/tmp/insights-core.egg) egg to /var/lib/insights/newest.egg
        # Additionally, copy NEW (/tmp/insights-core.egg.asc) to /var/lib/insights/newest.egg.asc
        try:
            logger.debug("Copying %s to %s." % (new_egg, constants.insights_core_newest))
            shutil.copyfile(new_egg, constants.insights_core_newest)
            shutil.copyfile(new_egg_gpg_sig, constants.insights_core_gpg_sig_newest)
        except IOError:
            logger.info("There was an error copying the new core from %s to %s." % (
                new_egg, constants.insights_core_newest))
            raise

        logger.debug("The new Insights Core was installed successfully.")
        return {'success': True}
232323
def path(self):
        """"""
        # If root, return '/'
        if self.dataset is self:
            return ''
        else:  # Otherwise recurse
            return self.dataset.path + '/' + self.name
1302503
def exe_to_egg(self, dist_filename, egg_tmp):
        """"""
        # Check for .pth file and set up prefix translations
        prefixes = get_exe_prefixes(dist_filename)
        to_compile = []
        native_libs = []
        top_level = {}

        def process(src, dst):
            s = src.lower()
            for old, new in prefixes:
                if s.startswith(old):
                    src = new + src[len(old):]
                    parts = src.split('/')
                    dst = os.path.join(egg_tmp, *parts)
                    dl = dst.lower()
                    if dl.endswith('.pyd') or dl.endswith('.dll'):
                        parts[-1] = bdist_egg.strip_module(parts[-1])
                        top_level[os.path.splitext(parts[0])[0]] = 1
                        native_libs.append(src)
                    elif dl.endswith('.py') and old != 'SCRIPTS/':
                        top_level[os.path.splitext(parts[0])[0]] = 1
                        to_compile.append(dst)
                    return dst
            if not src.endswith('.pth'):
                log.warn("WARNING: can't process %s", src)
            return None

        # extract, tracking .pyd/.dll->native_libs and .py -> to_compile
        unpack_archive(dist_filename, egg_tmp, process)
        stubs = []
        for res in native_libs:
            if res.lower().endswith('.pyd'):  # create stubs for .pyd's
                parts = res.split('/')
                resource = parts[-1]
                parts[-1] = bdist_egg.strip_module(parts[-1]) + '.py'
                pyfile = os.path.join(egg_tmp, *parts)
                to_compile.append(pyfile)
                stubs.append(pyfile)
                bdist_egg.write_stub(resource, pyfile)
        self.byte_compile(to_compile)  # compile .py's
        bdist_egg.write_safety_flag(
            os.path.join(egg_tmp, 'EGG-INFO'),
            bdist_egg.analyze_egg(egg_tmp, stubs))  # write zip-safety flag

        for name in 'top_level', 'native_libs':
            if locals()[name]:
                txt = os.path.join(egg_tmp, 'EGG-INFO', name + '.txt')
                if not os.path.exists(txt):
                    f = open(txt, 'w')
                    f.write('\n'.join(locals()[name]) + '\n')
                    f.close()
244492
def from_df(cls, path:PathOrStr, df:pd.DataFrame, folder:PathOrStr=None, label_delim:str=None, valid_pct:float=0.2,
                fn_col:IntsOrStrs=0, label_col:IntsOrStrs=1, suffix:str='', **kwargs:Any)->'ImageDataBunch':
        ""
        src = (ImageList.from_df(df, path=path, folder=folder, suffix=suffix, cols=fn_col)
                .split_by_rand_pct(valid_pct)
                .label_from_df(label_delim=label_delim, cols=label_col))
        return cls.create_from_ll(src, **kwargs)
1107505
def copy_metadata_to(self, target_dir):
        ""
        # normalize the path (so that a forward-slash in egg_info will
        # match using startswith below)
        norm_egg_info = os.path.normpath(self.egg_info)
        prefix = os.path.join(norm_egg_info, '')
        for path in self.ei_cmd.filelist.files:
            if path.startswith(prefix):
                target = os.path.join(target_dir, path[len(prefix):])
                ensure_directory(target)
                self.copy_file(path, target)