Sets the line-line predicates function.
483586
private void setLineLinePredicates_() {
        m_predicates_half_edge = Predicates.LineLinePredicates;
        m_predicates_cluster = Predicates.LinePointPredicates;

        m_max_dim[MatrixPredicate.InteriorInterior] = 1;
        m_max_dim[MatrixPredicate.InteriorBoundary] = 0;
        m_max_dim[MatrixPredicate.InteriorExterior] = 1;
        m_max_dim[MatrixPredicate.BoundaryInterior] = 0;
        m_max_dim[MatrixPredicate.BoundaryBoundary] = 0;
        m_max_dim[MatrixPredicate.BoundaryExterior] = 0;
        m_max_dim[MatrixPredicate.ExteriorInterior] = 1;
        m_max_dim[MatrixPredicate.ExteriorBoundary] = 0;
        m_max_dim[MatrixPredicate.ExteriorExterior] = 2;

        // set predicates that are always true/false
        if (m_perform_predicates[MatrixPredicate.ExteriorExterior])
        {
            m_matrix[MatrixPredicate.ExteriorExterior] = 2; // Always true
            m_perform_predicates[MatrixPredicate.ExteriorExterior] = false;
            m_predicate_count--;
        }
	}
505582
def logical_lines(lines):
    """"""
    if isinstance(lines, string_types):
        lines = StringIO(lines)
    buf = []
    for line in lines:
        if buf and not line.startswith(' '):
            chunk = ''.join(buf).strip()
            if chunk:
                yield chunk
            buf[:] = []

        buf.append(line)
    chunk = ''.join(buf).strip()
    if chunk:
        yield chunk
1050950
public static void setInputSlicePredicate(Configuration conf, SlicePredicate predicate)
    {
        conf.set(INPUT_PREDICATE_CONFIG, thriftToString(predicate));
    }
1066336
public void setLine (XY p1, XY p2) {
        setLine(p1.x(), p1.y(), p2.x(), p2.y());
    }
1276647
public final void setUtlInvLine(final UtlInvLine<RS, SalesInvoice,
    SalesInvoiceServiceLine, SalesInvoiceTaxLine,
      SalesInvoiceServiceTaxLine> pUtlInvLine) {
    this.utlInvLine = pUtlInvLine;
  }
1319395
public void setLineSeparator(String newline) {

    if (!LINE_SEPARATOR_CRLF.equals(newline) && !LINE_SEPARATOR_LF.equals(newline) && !LINE_SEPARATOR_LFCR.equals(newline)
        && !LINE_SEPARATOR_CR.equals(newline)) {
      throw new IllegalArgumentException(newline);
    }
    this.lineSeparator = newline;
  }
75801
public void set(double x1, double y1, double x2, double y2) {
        this.MODE = LINES;
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;

        calcG();
        dx[0] = x1 - x;
        dx[1] = x2 - x;
        dy[0] = y1 - y;
        dy[1] = y2 - y;
        dz[0] = z1 - 0;
        dz[1] = z2 - 0;
        if (dashed) calcDashedLine();
    }
233507
def _set_expressions(self, expressions):
        """"""
        self.expressions = {}
        for key, item in expressions.items():
            self.expressions[key] = {'function': item}
128302
def predicates(G: Graph, n: Node) -> Set[TriplePredicate]:
    
    return predicatesOut(G, n) | predicatesIn(G, n)
226332
public void replaceLines(int startLine, int endLine, List<String> replacementLines) {
    Preconditions.checkArgument(startLine <= endLine);
    List<String> originalLines = getLines();
    List<String> newLines = new ArrayList<>();
    for (int i = 0; i < originalLines.size(); i++) {
      int lineNum = i + 1;
      if (lineNum == startLine) {
        newLines.addAll(replacementLines);
      } else if (lineNum > startLine && lineNum <= endLine) {
        // Skip
      } else {
        newLines.add(originalLines.get(i));
      }
    }
    replaceLines(newLines);
  }
91735
public function setLines($lines)
    {
        if (!is_array($lines)) {
            $this->lines = array(
                $lines
            );
        } else {
            $this->lines = $lines;
        }

        return $this;
    }
603770
def _line_opt(self):
        """"""
        direction = self.search_direction.direction
        if self.constraints is not None:
            try:
                direction = self.constraints.project(self.x, direction)
            except ConstraintError:
                self._screen("CONSTRAINT PROJECT FAILED", newline=True)
                return False
        direction_norm = np.linalg.norm(direction)
        if direction_norm == 0:
            return False
        self.line.configure(self.x, direction/direction_norm)

        success, wolfe, qopt, fopt = \
            self.line_search(self.line, self.initial_step_size, self.epsilon)
        if success:
            self.step = qopt*self.line.axis
            self.initial_step_size = np.linalg.norm(self.step)
            self.x = self.x + self.step
            self.f = fopt
            if wolfe:
                self._screen("W")
            else:
                self._screen(" ")
                self.search_direction.reset()
            return True
        else:
            if self.debug_line:
                import matplotlib.pyplot as pt
                import datetime
                pt.clf()
                qs = np.arange(0.0, 100.1)*(5*self.initial_step_size/100.0)
                fs = np.array([self.line(q) for q in qs])
                pt.plot(qs, fs)
                pt.xlim(qs[0], qs[-1])
                fdelta = fs.max() - fs.min()
                if fdelta == 0.0:
                    fdelta = fs.mean()
                fmargin = fdelta*0.1
                pt.ylim(fs.min() - fmargin, fs.max() + fmargin)
                pt.title('fdelta = %.2e   fmean = %.2e' % (fdelta, fs.mean()))
                pt.xlabel('Line coordinate, q')
                pt.ylabel('Function value, f')
                pt.savefig('line_failed_%s.png' % (datetime.datetime.now().isoformat()))
            self._reset_state()
            return False
202320
public void setLine(double... points) {
        path = new GeneralPath();
        path.moveTo((float) points[0], (float) points[1]);
        segments = new Shape[points.length / 2 - 1];

        for (int i = 2; i < points.length;) {
            switch (points.length - i) {
            case 2:
                lastPart = new Line2D.Float((float) path.getCurrentPoint().getX(), (float) path
                        .getCurrentPoint().getY(), (float) points[i], (float) points[i + 1]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                i += 2;
                break;
            case 4:
                lastPart = new QuadCurve2D.Float((float) path.getCurrentPoint().getX(),
                        (float) path.getCurrentPoint().getY(), (float) points[i],
                        (float) points[i + 1], (float) points[i + 2], (float) points[i + 3]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;
                i += 4;
                break;
            case 6:
                lastPart = new CubicCurve2D.Double(path.getCurrentPoint().getX(), path
                        .getCurrentPoint().getY(), points[i], points[i + 1], points[i + 2],
                        points[i + 3], points[i + 4], points[i + 5]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;
                segments[i / 2 + 1] = lastPart;
                i += 6;
                break;
            default: // use two points and add one extra between 2nd and 3rd
                float x = (float) (points[i + 2] + points[i + 4]) / 2F;
                float y = (float) (points[i + 3] + points[i + 5]) / 2F;

                lastPart = new CubicCurve2D.Double(path.getCurrentPoint().getX(), path
                        .getCurrentPoint().getY(), points[i], points[i + 1], points[i + 2],
                        points[i + 3], x, y);

                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;

                i += 4;
            }
        }
    }
552214
private boolean lineLinePredicates_(int half_edge, int id_a, int id_b) {
        boolean bRelationKnown = true;

        if (m_perform_predicates[MatrixPredicate.InteriorInterior])
        {
            interiorLineInteriorLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorInterior);
        }

        if (m_perform_predicates[MatrixPredicate.InteriorBoundary])
        {
            interiorLineBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b, MatrixPredicate.InteriorBoundary);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorBoundary);
        }

        if (m_perform_predicates[MatrixPredicate.InteriorExterior])
        {
            interiorLineExteriorLine_(half_edge, id_a, id_b, MatrixPredicate.InteriorExterior);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.InteriorExterior);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryInterior])
        {
            interiorLineBoundaryLine_(half_edge, id_b, id_a, m_cluster_index_b, m_cluster_index_a, MatrixPredicate.BoundaryInterior);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryInterior);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryBoundary])
        {
            boundaryLineBoundaryLine_(half_edge, id_a, id_b, m_cluster_index_a, m_cluster_index_b);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryBoundary);
        }

        if (m_perform_predicates[MatrixPredicate.BoundaryExterior])
        {
            boundaryLineExteriorLine_(half_edge, id_a, id_b, m_cluster_index_a, MatrixPredicate.BoundaryExterior);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.BoundaryExterior);
        }

        if (m_perform_predicates[MatrixPredicate.ExteriorInterior])
        {
            interiorLineExteriorLine_(half_edge, id_b, id_a, MatrixPredicate.ExteriorInterior);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorInterior);
        }

        if (m_perform_predicates[MatrixPredicate.ExteriorBoundary])
        {
            boundaryLineExteriorLine_(half_edge, id_b, id_a, m_cluster_index_b, MatrixPredicate.ExteriorBoundary);
            bRelationKnown &= isPredicateKnown_(MatrixPredicate.ExteriorBoundary);
        }

        return bRelationKnown;
	}
1314161
def set_skips(self, skips):
        """"""
        skips.sort()
        internal_assert(lambda: len(set(skips)) == len(skips), "duplicate line skip(s) in skips", skips)
        self.skips = skips
91690
def _control_line(self, line):
        '''  '''
        if line > float(self.LINE_LAST_PIXEL):
            return int(self.LINE_LAST_PIXEL)
        elif line < float(self.LINE_FIRST_PIXEL):
            return int(self.LINE_FIRST_PIXEL)
        else:
            return line
275331
def add_predicate(self, predicate):
        
        _predicate = predicate
        if isinstance(predicate, partial):
            _predicate = 'partial(%s, %s, %s)' % (predicate.func, predicate.args, predicate.keywords)
        if LOG_OPTS['register']:
            hookenv.log('  Adding predicate for %s: %s' % (self.id(), _predicate), level=hookenv.DEBUG)
        self._predicates.append(predicate)