text stringlengths 0 828 |
|---|
# term 2 |
num2a = -self.m * self.otc * np.sin(self.ang) |
num2b = 2 * (self.w ** 2.0) * self.c * (self.tau ** (self.c - 1)) *\ |
np.cos(self.ang) |
num2c = 2 * self.c * (self.w ** (self.c * 2)) *\ |
(self.tau ** (2 * self.c - 1)) |
term2 = self.sigma0 * num2a * (num2b + num2c) / (self.denom ** 2) |
result = term1 + term2 |
return result" |
615,"def dim_dc(self, pars): |
r"""""" |
:math:Add formula |
"""""" |
self._set_parameters(pars) |
# term 1 |
num1a = self.m * np.sin(self.ang) * np.log(self.w * self.tau)\ |
* self.otc |
num1b = self.m * self.otc * np.pi / 2 * np.cos(np.pi / 2) |
term1 = self.sigma0 * (-num1a - num1b) / self.denom |
# term 2 |
num2a = -self.m * self.otc * np.cos(self.ang) |
num2b = -2 * np.log(self.w * self.tau) * self.otc * np.cos(self.ang) |
num2c = 2 * self.otc * np.pi / 2 * np.cos(self.ang) |
num2d = 2 * np.log(self.w * self.tau) * self.otc2 |
numerator = num2a * (num2b + num2c) + num2d |
term2 = self.sigma0 * numerator / (self.denom ** 2) |
result = term1 + term2 |
return result" |
616,"def add_view_file_mapping(self, pattern, cls): |
""""""Adds a mapping between a file and a view class. |
Pattern can be an extension in the form .EXT or a filename. |
"""""" |
if isinstance(pattern, str): |
if not pattern.endswith(""*""): |
_, ext = os.path.splitext(pattern) |
self.allowed_extensions.add(ext) |
pattern = re.compile(""^"" + re.escape(pattern).replace(""\\*"", "".+"") + ""$"", re.I) |
self.view_class_files_map.append((pattern, cls))" |
617,"def load_file(self, app, pathname, relpath, pypath): |
""""""Loads a file and creates a View from it. Files are split |
between a YAML front-matter and the content (unless it is a .yml file). |
"""""" |
try: |
view_class = self.get_file_view_cls(relpath) |
return create_view_from_file(pathname, source_template=relpath, view_class=view_class) |
except DeclarativeViewError: |
pass" |
618,"def get_file_view_cls(self, filename): |
""""""Returns the view class associated to a filename |
"""""" |
if filename is None: |
return self.default_view_class |
for pattern, cls in self.view_class_files_map: |
if pattern.match(filename): |
return cls |
return self.default_view_class" |
619,"def children(self, vertex): |
"""""" |
Return the list of immediate children of the given vertex. |
"""""" |
return [self.head(edge) for edge in self.out_edges(vertex)]" |
620,"def parents(self, vertex): |
"""""" |
Return the list of immediate parents of this vertex. |
"""""" |
return [self.tail(edge) for edge in self.in_edges(vertex)]" |
621,"def references(self): |
"""""" |
Return (tail, head) pairs for each edge in the |
graph. |
"""""" |
return [ |
(tail, head) |
for tail in self.vertices |
for head in self.children(tail) |
]" |
622,"def descendants(self, start, generations=None): |
"""""" |
Return the subgraph of all nodes reachable |
from the given start vertex, including that vertex. |
If specified, the optional `generations` argument specifies how |
many generations to limit to. |
"""""" |
visited = self.vertex_set() |
visited.add(start) |
to_visit = deque([(start, 0)]) |
while to_visit: |
vertex, depth = to_visit.popleft() |
if depth == generations: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.