Returns the number of degrees of freedom.
420969
def degrees_of_freedom(self):
        
        if len(self._set_xdata)==0 or len(self._set_ydata)==0: return None
        
        # Temporary hack: get the studentized residuals, which uses the massaged data
        # This should later be changed to get_massaged_data()
        r = self.studentized_residuals()
        
        # Happens if data / functions not defined
        if r == None: return
        
        # calculate the number of points
        N = 0.0
        for i in range(len(r)): N += len(r[i])
        
        return N-len(self._pnames)
181666
def get_out_degrees(self):
        '''
        
        '''
        degree = {}
        if self.attr['type'] is not DIRECTED_GRAPH:
            print('This function only works for directed graphs')
            return
        for n in self.get_node_list():
            degree[n] = len(self.get_out_neighbors(n))
        return degree
876507
def range_n(self):
        """"""
        return self.sphere_index - self.dn, self.sphere_index + self.dn
871071
def get_forces(self, a=None):
        """"""
        if a is None:
            a = self.a
        forces = np.zeros([len(a), 3], dtype=float)
        if self.mask is None:
            forces[self.mask] = self.force
        else:
            forces[:] = self.force
        return forces
636132
public int getUnknownRigidCount() {
		int total = 0;
		for (int i = 0; i < rigids.length; i++) {
			if( !rigids[i].known) {
				total++;
			}
		}
		return total;
	}
591573
def angle(self, vector):
        """"""
        return math.degrees(
            math.acos(
                self.dot(vector) /
                (self.magnitude() * vector.magnitude())
            )
        )
235257
def vecangle(v1, v2, deg=True):
    
    if np.array_equal(v1, v2):
        return 0.0
    dm = np.dot(v1, v2)
    cm = np.linalg.norm(v1) * np.linalg.norm(v2)
    angle = np.arccos(round(dm / cm, 10))  # Round here to prevent floating point errors
    return np.degrees([angle, ])[0] if deg else angle
579079
def degrees_to_dms(degrees):
    ''''''
    deg = int(degrees)
    min = int((degrees - deg)*60)
    sec = ((degrees - deg) - (min/60.0))*60*60
    return u'%d\u00b0%02u\'%05.2f"' % (deg, abs(min), abs(sec))
681883
public function countVariables()
	{
		$total	= 0;
		foreach( $this->methods as $method => $data )
			foreach( $this->methods[$method]['variables'] as $variable => $count )
				$total++;
		return $total;
	}
1367391
def ndims(self):
        """"""
        if self._dims is None:
            return None
        else:
            if self._ndims is None:
                self._ndims = len(self._dims)
            return self._ndims
509079
def angle2d(self):
        """"""
        if self.x==0:
            if   self.y<0:  return       math.pi/2.0*3
            elif self.y>0:  return       math.pi/2.0
            else:           return 0
        elif self.y==0:
            if   self.x<0:  return       math.pi
           #elif self.x>0:  return 0
            else:           return 0
        ans = math.atan( self.y / self.x )
        if self.x > 0:
            if self.y>0:    return ans
            else:           return ans + math.pi*2.0
        else:               return ans + math.pi
810658
def angle_and_rate(self):
        
        self._ensure_mode(self.MODE_GYRO_G_A)
        return self.value(0), self.value(1)
793397
def spin1_a(self):
        """"""
        return coordinates.cartesian_to_spherical_rho(
                                    self.spin1x, self.spin1y, self.spin1z)
276058
def get_forces(self, a):
        """"""
        f = np.zeros( [ len(a), 3 ], dtype=float )
        for c in self.calcs:
            f += c.get_forces(a)
        return f
1344464
def _degrees_to_direction(self, degrees):
        """"""
        try:
            degrees = float(degrees)
        except ValueError:
            return None
        if degrees < 0 or degrees > 360:
            return None
        if degrees <= 11.25 or degrees >= 348.76:
            return "N"
        elif degrees <= 33.75:
            return "NNE"
        elif degrees <= 56.25:
            return "NE"
        elif degrees <= 78.75:
            return "ENE"
        elif degrees <= 101.25:
            return "E"
        elif degrees <= 123.75:
            return "ESE"
        elif degrees <= 146.25:
            return "SE"
        elif degrees <= 168.75:
            return "SSE"
        elif degrees <= 191.25:
            return "S"
        elif degrees <= 213.75:
            return "SSW"
        elif degrees <= 236.25:
            return "SW"
        elif degrees <= 258.75:
            return "WSW"
        elif degrees <= 281.25:
            return "W"
        elif degrees <= 303.75:
            return "WNW"
        elif degrees <= 326.25:
            return "NW"
        elif degrees <= 348.75:
            return "NNW"
        else:
            return None
1260735
function getRotation(start, end) {
    // need two fingers
    if (start.length >= 2 && end.length >= 2) {
      return this.getAngle(end[1], end[0]) - this.getAngle(start[1], start[0]);
    }
    return 0;
  }
1074996
def get_rotations(self):
        """"""
        if self.centrosymmetric:
            return np.vstack((self.rotations, -self.rotations))
        else:
            return self.rotations