Add data_sources to layer and open files with data for the data_source.
437860
def load(self, rel_path=None):
        
        for k, v in self.layer.iteritems():
            self.add(k, v['module'], v.get('package'))
            filename = v.get('filename')
            path = v.get('path')
            if filename:
                # default path for data is in ../data
                if not path:
                    path = rel_path
                else:
                    path = os.path.join(rel_path, path)
                # filename can be a list or a string, concatenate list with
                # os.pathsep and append the full path to strings.
                if isinstance(filename, basestring):
                    filename = os.path.join(path, filename)
                else:
                    file_list = [os.path.join(path, f) for f in filename]
                    filename = os.path.pathsep.join(file_list)
                self.open(k, filename)
950524
def add_file(self, path):
        """"""
        libdoc = LibraryDocumentation(path)
        if len(libdoc.keywords) > 0:
            if libdoc.doc.startswith("Documentation for resource file"):
                # bah! The file doesn't have an file-level documentation
                # and libdoc substitutes some placeholder text.
                libdoc.doc = ""

            collection_id = self.add_collection(path, libdoc.name, libdoc.type,
                                                libdoc.doc, libdoc.version,
                                                libdoc.scope, libdoc.named_args,
                                                libdoc.doc_format)
            self._load_keywords(collection_id, libdoc=libdoc)
111692
def add_file(self, f):
        """"""

        if not self.files:
            self.files = set()

        self.files.add(f)

        self.locations.set(f.type_)
918780
def add(self, files, items):
        
        if isinstance(files, (str, bytes)):
            files = iter([files])
        for pathname in files:
            try:
                values = self._filemap[pathname]
            except KeyError:
                self._filemap[pathname] = items
            else:
                values.extend(items)
955977
def add_data_dict(self, datadict):
        '''
        '''

        self.set_codes(list(datadict.keys()))
        self.add_data(list(datadict.values()))
704003
def add(client, name, urls, link, relative_to, target, force):
    """"""
    try:
        with client.with_dataset(name=name) as dataset:
            target = target if target else None
            with progressbar(urls, label='Adding data to dataset') as bar:
                for url in bar:
                    client.add_data_to_dataset(
                        dataset,
                        url,
                        link=link,
                        target=target,
                        relative_to=relative_to,
                        force=force,
                    )
    except FileNotFoundError:
        raise BadParameter('Could not process {0}'.format(url))
162790
def add_files(session, imagedir, verbose):
  """"""

  def add_file(session, basename, userid, shotid, sessionid):
    """Parse a single filename and add it to the list."""
    session.add(File(userid, basename, sessionid, shotid))

  filenames = os.listdir(imagedir)
  for filename in filenames:
    basename, extension = os.path.splitext(filename)
    if extension == db_file_extension:
      if verbose>1: print("  Adding file '%s'..." % (basename))
      parts = string.split(basename, "_")
      ctype = parts[0]
      shotid = int(parts[2])
      userid = ctype + '_%d' % int(parts[1])
      if parts[0] == "Impostor":
        sessionid = 3
      elif parts[0] == "Genuine" and shotid <= 6:
        sessionid = 1
      elif parts[0] == "Genuine" and shotid > 6:
        sessionid = 2
        shotid = shotid - 6
      add_file(session, basename, userid, shotid, sessionid)
1036249
def add(self, files):
    
    if files.__class__.__name__ == 'str':
      self._files.append(files)
    else:
      self._files.extend(files)
763090
def add_from_file(self, fpath):
        """"""
        if self.tree is None:
            base, name = os.path.split(fpath)
            self.add_resource_path(base)
            self.tree = tree = ET.parse(fpath)
            self.root = tree.getroot()
            self.objects = {}
        else:
            # TODO: append to current tree
            pass
1138291
def add_source(self, url, **kwargs):
        
        self['sources'].append(dict(url=url, **kwargs))
865653
def files(self, data):
        """"""
        current_files = self.files
        if current_files:
            raise RuntimeError('Can not update existing files.')
        for key in data:
            current_files[key] = data[key]
333858
def addContinuousSet(self):
        
        self._openRepo()
        dataset = self._repo.getDatasetByName(self._args.datasetName)
        filePath = self._getFilePath(self._args.filePath,
                                     self._args.relativePath)
        name = getNameFromPath(self._args.filePath)
        continuousSet = continuous.FileContinuousSet(dataset, name)
        referenceSetName = self._args.referenceSetName
        if referenceSetName is None:
            raise exceptions.RepoManagerException(
                "A reference set name must be provided")
        referenceSet = self._repo.getReferenceSetByName(referenceSetName)
        continuousSet.setReferenceSet(referenceSet)
        continuousSet.populateFromFile(filePath)
        self._updateRepo(self._repo.insertContinuousSet, continuousSet)
819319
def _add(self, lines):
        '''

        '''
        lines = self._setup('ADD', lines)

        for line in lines:
            values = line.split(" ")
            frompath = values.pop(0)

            # Custom parsing for frompath

            # If it's a web address, add to install routine to get
            if frompath.startswith('http'):
                for topath in values:
                    self._parse_http(frompath, topath)

            # Add the file, and decompress in install
            elif re.search("[.](gz|gzip|bz2|xz)$", frompath.strip()):
                for topath in values:
                    self._parse_archive(frompath, topath)

            # Just add the files
            else:
                for topath in values:
                    self._add_files(frompath, topath)
481153
def add(source):
    
    new_data = DatasetClient().add_data(source)
    print_data([DataClient().get(new_data['data_id'])])
1086371
def load_sources(self, sources):
        """"""

        self.clear()
        for s in sources:

            if isinstance(s, dict):
                s = Model.create_from_dict(s)

            self.load_source(s, build_index=False)
        self._build_src_index()
916910
def UpdateResourcesFromDataFile(dstpath, srcpath, type_, names=None, 
                                languages=None):
    
    src = open(srcpath, "rb")
    data = src.read()
    src.close()
    UpdateResources(dstpath, data, type_, names, languages)
1180388
def add(self, entry, local_file):
        """"""
        row = self.rowClass()

        for key, val in entry.items():
            if key in self.columns:
                setattr(row, key, val)

        row.local_filename = os.path.join('.', os.path.relpath(local_file))

        self.rows.append(row)