Add a file to the cache
        :param name: name of the object to be pickled
        :param sig: signature for object
        :param obj: object to pickle
346019
def add(self, name: str, sig: Tuple, obj: object) -> None:
        
        if self._cache_directory is not None:
            if name in self._cache:
                os.remove(os.path.join(self._cache_directory, self._cache[name].loc))
            fname = os.path.join(self._cache_directory, str(uuid.uuid4()))
            with open(fname, 'wb') as f:
                pickle.dump(obj, f)
            self._cache[name] = _PickleJar.CacheEntry(sig, fname)
            self._update()
111145
function addIgnoreFile(ig, filepath) {
        if (fs.existsSync(filepath)) {
          ig.add(fs.readFileSync(filepath).toString());
        }
        return ig;
    }
406293
def add(self, obj):
        
        obj.controller = self.controller
        # Is the track already loaded or created?
        track = self.tracks.get(obj.name)
        if track:
            if track == obj:
                return
            # hijack the track data
            obj.keys = track.keys
            obj.controller = track.controller
            self.tracks[track.name] = obj
            self.track_index[self.track_index.index(track)] = obj
        else:
            # Add a new track
            obj.controller = self.controller
            self.tracks[obj.name] = obj
            self.track_index.append(obj)
1367028
def load(self):
        """"""
        if self.is_persisted:
            with open(self.file_name, 'rb') as f:
                self.object_property = pickle.load(f)
1230882
def add_property(self, name, fn, cached=True):
        
        if name in self.__properties:
            raise KeyError("Trying to add a property '%s' that already exists on this %s object." % (name, self.__class__.__name__))
        self.__properties[name] = (fn, cached)
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
1103059
def dump(self, obj, key=None):
        """"""
        if key is None:
            key = '_pickle'
        with preserve_current_directory():
            self.__file.cd()
            if sys.version_info[0] < 3:
                pickle.Pickler.dump(self, obj)
            else:
                super(Pickler, self).dump(obj)
            s = ROOT.TObjString(self.__io.getvalue())
            self.__io.reopen()
            s.Write(key)
            self.__file.GetFile().Flush()
            self.__pmap.clear()
1346767
def addFile(self,file):
        
        mylambda= lambda adict : { key.upper() : mylambda(adict[key]) if isinstance(adict[key],dict) else adict[key] for key in adict.keys() }
        if file.endswith('.json') :
            with open(file, 'r') as f:
                fileContent = mylambda(json.load(f))

        elif file.endswith('.ini') :
            parser  = configparser.ConfigParser()
            parser.read(file)
            fileContent = { section : { conflist[0].upper() : conflist[1] for conflist in parser.items(section) } for section in parser.sections() }
        else :
            raise FileFormatException()

        self._config = {**self._config, **mylambda(fileContent)}
457462
public void addFile(File file) throws HelloSignException {
        if (!(request instanceof SignatureRequest)) {
            throw new HelloSignException("Cannot add files to this unclaimed draft");
        }
        ((SignatureRequest) request).addFile(file);
    }
1267596
def add_object(self, name, obj):
        
        if iskeyword(name):
            name = '_' + name
        setattr(self, name, APIObject(self, **obj))
        self._objects[name] = getattr(self, name)
353333
def add_file(self, path, compress):
        
        if not os.path.isfile(path):
            raise ValueError('{} is not a file'.format(path))
        self.fileobj.seek(self.last_offset)

        with open(path, 'rb') as f:
            flags = os.stat(path).st_mode & 0o777
            self.add_fileobj(f, path, compress, flags)
1143905
public void cache(Identity oid, Object obj)
    {
        try
        {
            jcsCache.put(oid.toString(), obj);
        }
        catch (CacheException e)
        {
            throw new RuntimeCacheException(e);
        }
    }
1272422
def add_file(self, file, filename):
        
        self.files['_{}'.format(filename)] = (filename, file)
305134
def add(self, obj, metadata=None, update=False):
        
        if (obj not in self) or update:
            self[obj.id] = Object.fromdict(
                obj.id,
                dict(
                    metadata=obj.metadata.read() if metadata is None else metadata,
                    bitstreams=[bs._properties for bs in obj.bitstreams]))
            time.sleep(0.1)
            return self.objects[obj.id]
178759
def create_pickled_data(idevice, filename):
    
    data = {}
    for x in idevice.content:
        data[x] = idevice.content[x]
    location = filename
    pickle_file = open(location, 'wb')
    pickle.dump(data, pickle_file, protocol=pickle.HIGHEST_PROTOCOL)
    pickle_file.close()
1031056
def make(cls, obj):
        ''''''
        try:
            cls._cache.append(Task(obj))
        except Exception:
            logger.exception('Unable to make task for %s' % repr(obj))
460085
def set(self, prefix, url, obj):
        
        if not self.cache_dir:
            return

        filename = self._get_cache_file(prefix, url)

        try:
            os.makedirs(os.path.join(self.cache_dir, prefix))
        except OSError:
            pass

        with open(filename, 'wb') as file:
            pickle.dump(obj, file)