Read relationship data from a PEP file.
774163
private void readRelationships()
   {
      for (MapRow row : getTable("CONTAB"))
      {
         Task task1 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_1"));
         Task task2 = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID_2"));

         if (task1 != null && task2 != null)
         {
            RelationType type = row.getRelationType("TYPE");
            Duration lag = row.getDuration("LAG");
            Relation relation = task2.addPredecessor(task1, type, lag);
            m_eventManager.fireRelationReadEvent(relation);
         }
      }
   }
1207767
def __parse_relation():
    ''''''
    relation_filename = get_file('relation.tsv')
    vertice_filename = get_file('vertice.tsv')
    relation_textfile = open(relation_filename, 'r')
    vertice_textfile = open(vertice_filename, 'r')

    # Parse vertice:
    vertices = {}

    next(vertice_textfile)

    for line in vertice_textfile:
        tokens = line.strip().split('\t')
        vertices[tokens[0]] = tokens[1]

    next(relation_textfile)

    for line in relation_textfile:
        tokens = line.strip().split('\t')

        source_chebi_id = int(vertices[tokens[3]])
        target_chebi_id = int(vertices[tokens[2]])
        typ = tokens[1]

        if source_chebi_id not in __OUTGOINGS:
            __OUTGOINGS[source_chebi_id] = []

        if target_chebi_id not in __INCOMINGS:
            __INCOMINGS[target_chebi_id] = []

        target_relation = Relation(typ, str(target_chebi_id), tokens[4])
        source_relation = Relation(typ, str(source_chebi_id), tokens[4])

        __OUTGOINGS[source_chebi_id].append(target_relation)
        __INCOMINGS[target_chebi_id].append(source_relation)
1097395
private void readRelationships(net.sf.mpxj.ganttproject.schema.Task gpTask)
   {
      for (Depend depend : gpTask.getDepend())
      {
         Task task1 = m_projectFile.getTaskByUniqueID(Integer.valueOf(NumberHelper.getInt(gpTask.getId()) + 1));
         Task task2 = m_projectFile.getTaskByUniqueID(Integer.valueOf(NumberHelper.getInt(depend.getId()) + 1));
         if (task1 != null && task2 != null)
         {
            Duration lag = Duration.getInstance(NumberHelper.getInt(depend.getDifference()), TimeUnit.DAYS);
            Relation relation = task2.addPredecessor(task1, getRelationType(depend.getType()), lag);
            m_eventManager.fireRelationReadEvent(relation);
         }
      }
   }
878018
def _read_potentials(self, pot_dir):
        
        if self.assignments['potentials'] is not None:
            print('Potentials already imported. Will not overwrite!')
            return
        else:
            self.assignments['potentials'] = {}

        pot_files = sorted(glob(pot_dir + os.sep + 'pot*.dat'))
        for nr, filename in enumerate(pot_files):
            with open(filename, 'r') as fid:
                pot_data = np.loadtxt(fid)

                nids = self.nodeman.add_data(
                    pot_data[:, 2:4],
                )
                # store cids for later retrieval
                self.assignments['potentials'][nr] = nids
746574
def read(self, line, f, data):
        """"""
        f.readline()
        f.readline()
        N = len(data["symbols"])
        # if the data are already read before, just overwrite them
        numbers = data.get("numbers")
        if numbers is None:
            numbers = np.zeros(N, int)
            data["numbers"] = numbers
        coordinates = data.get("coordinates")
        if coordinates is None:
            coordinates = np.zeros((N,3), float)
            data["coordinates"] = coordinates
        for i in range(N):
            words = f.readline().split()
            numbers[i] = int(float(words[1]))
            coordinates[i,0] = float(words[2])*angstrom
            coordinates[i,1] = float(words[3])*angstrom
            coordinates[i,2] = float(words[4])*angstrom
361959
protected void processRelationships(final ParserData parserData) {
        // Process the level relationships
        for (final Map.Entry<String, List<Relationship>> entry : parserData.getLevelRelationships().entrySet()) {
            final String levelId = entry.getKey();
            final Level level = parserData.getLevels().get(levelId);

            assert level != null;

            for (final Relationship relationship : entry.getValue()) {
                processRelationship(parserData, level, relationship);
            }
        }

        // Process the topic relationships
        for (final Map.Entry<String, List<Relationship>> entry : parserData.getTopicRelationships().entrySet()) {
            final String topicId = entry.getKey();
            final SpecTopic specTopic = parserData.getSpecTopics().get(topicId);

            assert specTopic != null;

            for (final Relationship relationship : entry.getValue()) {
                processRelationship(parserData, specTopic, relationship);
            }
        }
    }
1068258
def get_relationship_dicts(self):
        """"""
        if not self.relationships:
            return None
        for goid, goobj in self.go2obj.items():
            for reltyp, relset in goobj.relationship.items():
                relfwd_goids = set(o.id for o in relset)
                # for relfwd_goid in relfwd_goids:
                #     assert relfwd_goid in self.go2obj, "{GO} {REL} NOT FOUND {GO_R}".format(
                #         GO=goid, REL=reltyp, GO_R=relfwd_goid)
                print("CountRelativesInit RELLLLS", goid, goobj.id, reltyp, relfwd_goids)
1217268
def from_dict(cls, d):
        """"""
        relationship = super(cls, cls).from_dict(d)
        if relationship.name is not None:
            relationship.name = Name.from_dict(relationship.name)
        return relationship
98374
private Set<RelationshipTuple> getRels(String relsDatastreamName) {
        List<Datastream> relsDatastreamVersions = m_datastreams.get(relsDatastreamName);

        if (relsDatastreamVersions == null || relsDatastreamVersions.size() == 0) {
            return new HashSet<RelationshipTuple>();
        }

        Datastream latestRels = relsDatastreamVersions.get(0);

        for (Datastream v : relsDatastreamVersions) {
           	if (v.DSCreateDT == null){
           		latestRels = v;
           		break;
           	}
            if (v.DSCreateDT.getTime() > latestRels.DSCreateDT.getTime()) {
                latestRels = v;
            }
        }

        try {
            return RDFRelationshipReader.readRelationships(latestRels);
        } catch (ServerException e) {
            throw new RuntimeException("Error reading object relationships in " + relsDatastreamName, e);
        }
    }
557965
def read(self, line, f, data):
        """"""
        line = f.readline()
        assert(line == " $HESS\n")
        while line != " $END\n":
            line = f.readline()
920871
def get_dataset(self, key, info):
        """"""
        logger.debug("Reading %s.", key)
        return self.file_content[key.name]
1287764
def _read_pem_file(cls, filename, from_package=False):
        '''
        '''
        _logger.debug('Reading PEM {0}.'.format(filename))

        if from_package:
            return wpull.util.filter_pem(wpull.util.get_package_data(filename))

        with open(filename, 'rb') as in_file:
            return wpull.util.filter_pem(in_file.read())
950517
def _get_sorted_relationships(self, goterm):
        """"""
        if goterm.id in self.goids_seen:
            return
        self.goids_seen.add(goterm.id)
        for goterm_upper in goterm.get_goterms_upper():
            self._get_sorted_relationships(goterm_upper)
        self.goterms_sorted.append(goterm)
1211854
def read(self, keyed=False, extended=False, cast=True, relations=False, limit=None):
        
        result = []
        rows = self.iter(keyed=keyed, extended=extended, cast=cast, relations=relations)
        for count, row in enumerate(rows, start=1):
            result.append(row)
            if count == limit:
                break
        return result
109088
def _get_relationship_value(self, obj, column):
        
        if column['__col__'].uselist:
            value = self._get_to_many_relationship_value(obj, column)
        else:
            value = self._get_to_one_relationship_value(obj, column)

        return value
781222
def from_file(cls, source):
        """"""
        if hasattr(source, 'read'):
            relations = cls.from_string(source.read())
        else:
            with open(source) as f:
                relations = cls.from_string(f.read())
        return relations
618305
def read_pyproject_conf(data: str) -> dict:
    
    doc = parse(data)
    try:
        return doc["tool"]["commitizen"]
    except exceptions.NonExistentKey:
        return {}