          self.limit = limit
          self.train_locs = self.walk_corpus(self.train_path)
          self.dev_locs = self.walk_corpus(self.dev_path)
  
      @property
      def train_tuples(self):
          i = 0
          for loc in self.train_locs:
              gold_tuples = read_json_file(loc)
              for item in gold_tuples:
                  yield item
 
</s> remove         for loc in self.train_locs:
            gold_tuples = read_json_file(loc)
 </s> add         for loc in locs:
            loc = util.ensure_path(loc)
            if loc.parts[-1].endswith('json'):
                gold_tuples = read_json_file(loc)
            elif loc.parts[-1].endswith('msg'):
                with loc.open('rb') as file_:
                    gold_tuples = msgpack.load(file_, encoding='utf8')
            else:
                msg = "Cannot read from file: %s. Supported formats: .json, .msg"
                raise ValueError(msg % loc) </s> remove         self.train_locs = self.walk_corpus(self.train_path)
        self.dev_locs = self.walk_corpus(self.dev_path)
 </s> add         if isinstance(train, str) or isinstance(train, Path):
            train = self.read_tuples(self.walk_corpus(train))
            dev = self.read_tuples(self.walk_corpus(dev)) </s> remove                 if self.limit and i >= self.limit:
 </s> add                 if limit and i >= limit: </s> remove         i = 0
        for loc in self.dev_locs:
            gold_tuples = read_json_file(loc)
            for item in gold_tuples:
                yield item
                i += len(item[1])
                if self.limit and i >= self.limit:
                    break
 </s> add         locs = (self.tmp_dir / 'dev').iterdir()
        yield from self.read_tuples(locs, limit=self.limit)
   
    @property
    def train_tuples(self):
        locs = (self.tmp_dir / 'train').iterdir()
        yield from self.read_tuples(locs, limit=self.limit) </s> remove         self.train_path = util.ensure_path(train_path)
        self.dev_path = util.ensure_path(dev_path)
 </s> add 
        # Write temp directory with one doc per file, so we can shuffle
        # and stream
        self.tmp_dir = Path(tempfile.mkdtemp())
        self.write_msgpack(self.tmp_dir / 'train', train)
        self.write_msgpack(self.tmp_dir / 'dev', dev)

    def __del__(self):
        shutil.rmtree(self.tmp_dir)

    @staticmethod
    def write_msgpack(directory, doc_tuples):
        if not directory.exists():
            directory.mkdir()
        for i, doc_tuple in enumerate(doc_tuples):
            with open(directory / '{}.msg'.format(i), 'wb') as file_:
                msgpack.dump([doc_tuple], file_, use_bin_type=True, encoding='utf8')
    
    @staticmethod
    def walk_corpus(path):
        path = util.ensure_path(path)
        if not path.is_dir():
            return [path]
        paths = [path]
        locs = []
        seen = set()
        for path in paths:
            if str(path) in seen:
                continue
            seen.add(str(path))
            if path.parts[-1].startswith('.'):
                continue
            elif path.is_dir():
                paths.extend(path.iterdir())
            elif path.parts[-1].endswith('.json'):
                locs.append(path)
        return locs

    @staticmethod
    def read_tuples(locs, limit=0):
          self.limit = limit
          self.train_locs = self.walk_corpus(self.train_path)
          self.dev_locs = self.walk_corpus(self.dev_path)
  
        # Write temp directory with one doc per file, so we can shuffle
        # and stream
        self.tmp_dir = Path(tempfile.mkdtemp())
        self.write_msgpack(self.tmp_dir / 'train', train)
        self.write_msgpack(self.tmp_dir / 'dev', dev)

    def __del__(self):
        shutil.rmtree(self.tmp_dir)

    @staticmethod
    def write_msgpack(directory, doc_tuples):
        if not directory.exists():
            directory.mkdir()
        for i, doc_tuple in enumerate(doc_tuples):
            with open(directory / '{}.msg'.format(i), 'wb') as file_:
                msgpack.dump([doc_tuple], file_, use_bin_type=True, encoding='utf8')
    
    @staticmethod
    def walk_corpus(path):
        path = util.ensure_path(path)
        if not path.is_dir():
            return [path]
        paths = [path]
        locs = []
        seen = set()
        for path in paths:
            if str(path) in seen:
                continue
            seen.add(str(path))
            if path.parts[-1].startswith('.'):
                continue
            elif path.is_dir():
                paths.extend(path.iterdir())
            elif path.parts[-1].endswith('.json'):
                locs.append(path)
        return locs

    @staticmethod
    def read_tuples(locs, limit=0):
        # Write temp directory with one doc per file, so we can shuffle
        # and stream
        self.tmp_dir = Path(tempfile.mkdtemp())
        self.write_msgpack(self.tmp_dir / 'train', train)
        self.write_msgpack(self.tmp_dir / 'dev', dev)

    def __del__(self):
        shutil.rmtree(self.tmp_dir)

    @staticmethod
    def write_msgpack(directory, doc_tuples):
        if not directory.exists():
            directory.mkdir()
        for i, doc_tuple in enumerate(doc_tuples):
            with open(directory / '{}.msg'.format(i), 'wb') as file_:
                msgpack.dump([doc_tuple], file_, use_bin_type=True, encoding='utf8')
    
    @staticmethod
    def walk_corpus(path):
        path = util.ensure_path(path)
        if not path.is_dir():
            return [path]
        paths = [path]
        locs = []
        seen = set()
        for path in paths:
            if str(path) in seen:
                continue
            seen.add(str(path))
            if path.parts[-1].startswith('.'):
                continue
            elif path.is_dir():
                paths.extend(path.iterdir())
            elif path.parts[-1].endswith('.json'):
                locs.append(path)
        return locs

    @staticmethod
    def read_tuples(locs, limit=0):
          i = 0
          for loc in self.train_locs:
              gold_tuples = read_json_file(loc)
              for item in gold_tuples:
                  yield item
keep keep keep keep replace replace keep keep keep keep keep
 Revert "Merge branch 'develop' of https://github.com/explosion/spaCy into develop"

This reverts commit c9ba3d3c2dc7067cf8bd55f878cec45a8c6d73d4, reversing
changes made to 92c26a35d425d4e8ca1b805ea776ea10f5ded3df. 
spacy/gold.pyx