Add object file to the jit. object_file can be instance of
        :class:ObjectFile or a string representing file system path
774718
def add_object_file(self, obj_file):
        
        if isinstance(obj_file, str):
            obj_file = object_file.ObjectFileRef.from_path(obj_file)

        ffi.lib.LLVMPY_MCJITAddObjectFile(self, obj_file)
1274314
def add_file(self, user, file_obj, **metadata):
        
        user_dir = self.user_dir(user)
        if not user_dir.exists():
            user_dir.mkdir(mode=0o775)

        handle = str(uuid1())
        file_path = user_dir / handle

        with file_path.open("wb") as out:
            for chunk in iter(lambda: file_obj.read(CHUNK_SIZE), b""):
                out.write(chunk)

        if metadata:
            meta_file = user_dir / f"{handle}.metadata"
            with meta_file.open("wb") as out:
                metadata_json = json.dumps(metadata, skipkeys=True).encode("ascii")
                out.write(metadata_json)

        return handle
1151862
def tofile(self, fileobj):
		
		for entry in self:
			print >>fileobj, str(entry)
		fileobj.close()
1216482
def add(self, *files):
        """"""

        try:
            _run_command(("git", "add") + files)
        except CalledProcessError:
            # Only if the command fails we check if the files
            # exist, because git-add most of the time fails when
            # the provided files are not found.
            for f in files:
                if not Path(f).exists():
                    raise FileNotFoundError(f"No such file or directory: {f}")
1084930
public void addFile(String path, File file) throws IOException {
    addFile(path, file, null);
  }
1125121
def upload(self, file_obj):
        
        return self._client.upload_object(
            self._instance, self._bucket, self.name, file_obj)
127996
def output(file_like_object, path, verbose=False):
    """"""
    if not path:
        for line in file_like_object:
            if verbose:
                print_info(line.rstrip())
            else:
                print(line.rstrip())
    else:
        try:
            object_file = open(os.path.expanduser(path), "w", encoding="utf-8")
            shutil.copyfileobj(file_like_object, object_file)
            object_file.close()
        except EnvironmentError as xxx_todo_changeme:
            (errno, strerror) = xxx_todo_changeme.args
            error_line_list = [
                "Could not write to object_file: {}".format(path),
                "I/O error({}): {}".format(errno, strerror),
            ]
            error_message = "\n".join(error_line_list)
            raise d1_cli.impl.exceptions.CLIError(error_message)
1369804
def insert(self, path, simfile):
        
        if self.state is not None:
            simfile.set_state(self.state)
        mountpoint, chunks = self.get_mountpoint(path)

        if mountpoint is None:
            self._files[self._join_chunks(chunks)] = simfile
            return True
        else:
            return mountpoint.insert(chunks, simfile)
818689
def add_fileobj(self, fname, fcontent):
        
        tar_info = tarfile.TarInfo(fname)
        if isinstance(fcontent, io.BytesIO):
            tar_info.size = len(fcontent.getvalue())
        elif isinstance(fcontent, io.StringIO):
            tar_info.size = len(fcontent.getvalue())
            fcontent = io.BytesIO(fcontent.getvalue().encode("utf8"))
        else:
            if hasattr(fcontent, "readable"):
                fcontent = fcontent
            tar_info.size = len(fcontent)
            if isinstance(fcontent, str):
                fcontent = fcontent.encode("utf8")
            fcontent = io.BytesIO(fcontent)
        self._ios_to_add[tar_info] = fcontent
1106832
def add_files_to_git_repository(base_dir, files, description):
    
    if not os.path.isdir(base_dir):
        printOut('Output path is not a directory, cannot add files to git repository.')
        return

    # find out root directory of repository
    gitRoot = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'],
                               cwd=base_dir,
                               stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout = gitRoot.communicate()[0]
    if gitRoot.returncode != 0:
        printOut('Cannot commit results to repository: git rev-parse failed, perhaps output path is not a git directory?')
        return
    gitRootDir = decode_to_string(stdout).splitlines()[0]

    # check whether repository is clean
    gitStatus = subprocess.Popen(['git','status','--porcelain', '--untracked-files=no'],
                                 cwd=gitRootDir,
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (stdout, stderr) = gitStatus.communicate()
    if gitStatus.returncode != 0:
        printOut('Git status failed! Output was:\n' + decode_to_string(stderr))
        return

    if stdout:
        printOut('Git repository has local changes, not commiting results.')
        return

    # add files to staging area
    files = [os.path.realpath(file) for file in files]
    # Use --force to add all files in result-files directory even if .gitignore excludes them
    gitAdd = subprocess.Popen(['git', 'add', '--force', '--'] + files,
                               cwd=gitRootDir)
    if gitAdd.wait() != 0:
        printOut('Git add failed, will not commit results!')
        return

    # commit files
    printOut('Committing results files to git repository in ' + gitRootDir)
    gitCommit = subprocess.Popen(['git', 'commit', '--file=-', '--quiet'],
                                 cwd=gitRootDir,
                                 stdin=subprocess.PIPE)
    gitCommit.communicate(description.encode('UTF-8'))
    if gitCommit.returncode != 0:
        printOut('Git commit failed!')
        return
654747
def CacheFileObject(self, path_spec, file_object):
    
    self._file_object_cache.CacheObject(path_spec.comparable, file_object)
1288394
public static File writeObjectToFile(Object o, File file) throws IOException {
    return writeObjectToFile(o, file, false);
  }
1085290
def put_files(self, files, content_type=None, compress=None, cache_control=None, block=True):
    
    def base_uploadfn(path, content, interface):
      interface.put_file(path, content, content_type, compress, cache_control=cache_control)

    for path, content in files:
      content = compression.compress(content, method=compress)
      uploadfn = partial(base_uploadfn, path, content)

      if len(self._threads):
        self.put(uploadfn)
      else:
        uploadfn(self._interface)

    if block:
      desc = 'Uploading' if self.progress else None
      self.wait(desc)

    return self
679464
def addFile(src, dest=nil)
      orig = dest
      dest = File.join(@defaultPath, File.basename(src)) if !dest
      @files[src] = dest
    end
513272
def _addSpecfile(self, specfile, path):
        
        datatypeStatus = {'rm': False, 'ci': False, 'smi': False, 'sai': False,
                          'si': False
                          }
        self.info[specfile] = {'path': path, 'status': datatypeStatus}
969553
def _AddFileDescriptor(self, file_desc):
    

    if not isinstance(file_desc, descriptor.FileDescriptor):
      raise TypeError('Expected instance of descriptor.FileDescriptor.')
    self._file_descriptors[file_desc.name] = file_desc
487229
def add(self, directory, path=None) -> None:
        """"""
        objecttools.valid_variable_identifier(directory)
        if path is None:
            path = directory
        setattr(self, directory, path)