title stringclasses 1
value | text stringlengths 46 1.11M | id stringlengths 27 30 |
|---|---|---|
examples/advanced/relativity.py/eq1
def eq1():
r = Symbol("r")
e = Rmn.dd(0, 0)
e = e.subs(nu(r), -lam(r))
pprint(dsolve(e, lam(r))) | negative_train_query0_00099 | |
examples/advanced/relativity.py/eq2
def eq2():
r = Symbol("r")
e = Rmn.dd(1, 1)
C = Symbol("CC")
e = e.subs(nu(r), -lam(r))
pprint(dsolve(e, lam(r))) | negative_train_query0_00100 | |
examples/advanced/relativity.py/eq3
def eq3():
r = Symbol("r")
e = Rmn.dd(2, 2)
e = e.subs(nu(r), -lam(r))
pprint(dsolve(e, lam(r))) | negative_train_query0_00101 | |
examples/advanced/relativity.py/eq4
def eq4():
r = Symbol("r")
e = Rmn.dd(3, 3)
e = e.subs(nu(r), -lam(r))
pprint(dsolve(e, lam(r)))
pprint(dsolve(e, lam(r), 'best')) | negative_train_query0_00102 | |
examples/advanced/relativity.py/main
def main():
print("Initial metric:")
pprint(gdd)
print("-"*40)
print("Christoffel symbols:")
pprint_Gamma_udd(0, 1, 0)
pprint_Gamma_udd(0, 0, 1)
print()
pprint_Gamma_udd(1, 0, 0)
pprint_Gamma_udd(1, 1, 1)
pprint_Gamma_udd(1, 2, 2)
pprint_... | negative_train_query0_00103 | |
examples/advanced/relativity.py/MT/__init__
class MT: def __init__(self, m):
self.gdd = m
self.guu = m.inv() | negative_train_query0_00104 | |
examples/advanced/relativity.py/MT/__str__
class MT: def __str__(self):
return "g_dd =\n" + str(self.gdd) | negative_train_query0_00105 | |
examples/advanced/relativity.py/MT/dd
class MT: def dd(self, i, j):
return self.gdd[i, j] | negative_train_query0_00106 | |
examples/advanced/relativity.py/MT/uu
class MT: def uu(self, i, j):
return self.guu[i, j] | negative_train_query0_00107 | |
examples/advanced/relativity.py/G/__init__
class G: def __init__(self, g, x):
self.g = g
self.x = x | negative_train_query0_00108 | |
examples/advanced/relativity.py/G/udd
class G: def udd(self, i, k, l):
g = self.g
x = self.x
r = 0
for m in [0, 1, 2, 3]:
r += g.uu(i, m)/2 * (g.dd(m, k).diff(x[l]) + g.dd(m, l).diff(x[k])
- g.dd(k, l).diff(x[m]))
return r | negative_train_query0_00109 | |
examples/advanced/relativity.py/Riemann/__init__
class Riemann: def __init__(self, G, x):
self.G = G
self.x = x | negative_train_query0_00110 | |
examples/advanced/relativity.py/Riemann/uddd
class Riemann: def uddd(self, rho, sigma, mu, nu):
G = self.G
x = self.x
r = G.udd(rho, nu, sigma).diff(x[mu]) - G.udd(rho, mu, sigma).diff(x[nu])
for lam in [0, 1, 2, 3]:
r += G.udd(rho, mu, lam)*G.udd(lam, nu, sigma) \
... | negative_train_query0_00111 | |
examples/advanced/relativity.py/Ricci/__init__
class Ricci: def __init__(self, R, x):
self.R = R
self.x = x
self.g = R.G.g | negative_train_query0_00112 | |
examples/advanced/relativity.py/Ricci/dd
class Ricci: def dd(self, mu, nu):
R = self.R
x = self.x
r = 0
for lam in [0, 1, 2, 3]:
r += R.uddd(lam, mu, lam, nu)
return r | negative_train_query0_00113 | |
examples/advanced/relativity.py/Ricci/ud
class Ricci: def ud(self, mu, nu):
r = 0
for lam in [0, 1, 2, 3]:
r += self.g.uu(mu, lam)*self.dd(lam, nu)
return r.expand() | negative_train_query0_00114 | |
examples/advanced/gibbs_phenomenon.py/l2_norm
def l2_norm(f, lim):
"""
Calculates L2 norm of the function "f", over the domain lim=(x, a, b).
x ...... the independent variable in f over which to integrate
a, b ... the limits of the interval
Examples
========
>>> from sympy import Symbol
... | negative_train_query0_00115 | |
examples/advanced/gibbs_phenomenon.py/l2_inner_product
def l2_inner_product(a, b, lim):
"""
Calculates the L2 inner product (a, b) over the domain lim.
"""
return integrate(conjugate(a)*b, lim) | negative_train_query0_00116 | |
examples/advanced/gibbs_phenomenon.py/l2_projection
def l2_projection(f, basis, lim):
"""
L2 projects the function f on the basis over the domain lim.
"""
r = 0
for b in basis:
r += l2_inner_product(f, b, lim) * b
return r | negative_train_query0_00117 | |
examples/advanced/gibbs_phenomenon.py/l2_gram_schmidt
def l2_gram_schmidt(list, lim):
"""
Orthonormalizes the "list" of functions using the Gram-Schmidt process.
Examples
========
>>> from sympy import Symbol
>>> from gibbs_phenomenon import l2_gram_schmidt
>>> x = Symbol('x', real=True) ... | negative_train_query0_00118 | |
examples/advanced/gibbs_phenomenon.py/integ
def integ(f):
return integrate(f, (x, -pi, 0)) + integrate(-f, (x, 0, pi)) | negative_train_query0_00119 | |
examples/advanced/gibbs_phenomenon.py/series
def series(L):
"""
Normalizes the series.
"""
r = 0
for b in L:
r += integ(b)*b
return r | negative_train_query0_00120 | |
examples/advanced/gibbs_phenomenon.py/msolve
def msolve(f, x):
"""
Finds the first root of f(x) to the left of 0.
The x0 and dx below are tailored to get the correct result for our
particular function --- the general solver often overshoots the first
solution.
"""
f = lambdify(x, f)
x0 ... | negative_train_query0_00121 | |
examples/advanced/gibbs_phenomenon.py/main
def main():
L = [1]
for i in range(1, 100):
L.append(cos(i*x))
L.append(sin(i*x))
# next 2 lines equivalent to L = l2_gram_schmidt(L, (x, -pi, pi)), but faster:
L[0] /= sqrt(2)
L = [f/sqrt(pi) for f in L]
f = series(L)
print("Fourie... | negative_train_query0_00122 | |
examples/advanced/hydrogen.py/main
def main():
print("Hydrogen radial wavefunctions:")
a, r = symbols("a r")
print("R_{21}:")
pprint(R_nl(2, 1, a, r))
print("R_{60}:")
pprint(R_nl(6, 0, a, r))
print("Normalization:")
i = Integral(R_nl(1, 0, 1, r)**2 * r**2, (r, 0, oo))
pprint(Eq(i, ... | negative_train_query0_00123 | |
examples/advanced/curvilinear_coordinates.py/laplace
def laplace(f, g_inv, g_det, X):
"""
Calculates Laplace(f), using the inverse metric g_inv, the determinant of
the metric g_det, all in variables X.
"""
r = 0
for i in range(len(X)):
for j in range(len(X)):
r += g_inv[i, j]... | negative_train_query0_00124 | |
examples/advanced/curvilinear_coordinates.py/transform
def transform(name, X, Y, g_correct=None, recursive=False):
"""
Transforms from cartesian coordinates X to any curvilinear coordinates Y.
It printing useful information, like Jacobian, metric tensor, determinant
of metric, Laplace operator in the n... | negative_train_query0_00125 | |
examples/advanced/curvilinear_coordinates.py/main
def main():
mu, nu, rho, theta, phi, sigma, tau, a, t, x, y, z, w = symbols(
"mu, nu, rho, theta, phi, sigma, tau, a, t, x, y, z, w")
transform("polar", Matrix([rho*cos(phi), rho*sin(phi)]), [rho, phi])
transform("cylindrical", Matrix([rho*cos(phi)... | negative_train_query0_00126 | |
bin/coverage_report.py/generate_covered_files
def generate_covered_files(top_dir):
for dirpath, dirnames, filenames in os.walk(top_dir):
omit_dirs = [dirn for dirn in dirnames if omit_dir_re.match(dirn)]
for x in omit_dirs:
dirnames.remove(x)
for filename in filenames:
... | negative_train_query0_00127 | |
bin/coverage_report.py/make_report
def make_report(source_dir, report_dir, use_cache=False, slow=False):
# code adapted from /bin/test
bin_dir = os.path.abspath(os.path.dirname(__file__)) # bin/
sympy_top = os.path.split(bin_dir)[0] # ../
sympy_dir = os.path.join(sympy_top, 'sympy') # ../sympy/
i... | negative_train_query0_00128 | |
bin/sympy_time_cache.py/new_import
def new_import(name, globals={}, locals={}, fromlist=[]):
global pp
if name in seen:
return old_import(name, globals, locals, fromlist)
seen.add(name)
node = TreeNode(name)
pp.add_child(node)
old_pp = pp
pp = node
#Do the actual import
t1... | negative_train_query0_00129 | |
bin/sympy_time_cache.py/TreeNode/__init__
class TreeNode: def __init__(self, name):
self._name = name
self._children = []
self._time = 0 | negative_train_query0_00130 | |
bin/sympy_time_cache.py/TreeNode/__str__
class TreeNode: def __str__(self):
return "%s: %s" % (self._name, self._time) | negative_train_query0_00131 | |
bin/sympy_time_cache.py/TreeNode/add_child
class TreeNode: def add_child(self, node):
self._children.append(node) | negative_train_query0_00132 | |
bin/sympy_time_cache.py/TreeNode/children
class TreeNode: def children(self):
return self._children | negative_train_query0_00133 | |
bin/sympy_time_cache.py/TreeNode/child
class TreeNode: def child(self, i):
return self.children()[i] | negative_train_query0_00134 | |
bin/sympy_time_cache.py/TreeNode/set_time
class TreeNode: def set_time(self, time):
self._time = time | negative_train_query0_00135 | |
bin/sympy_time_cache.py/TreeNode/time
class TreeNode: def time(self):
return self._time | negative_train_query0_00136 | |
bin/sympy_time_cache.py/TreeNode/exclusive_time
class TreeNode: def exclusive_time(self):
return self.total_time() - sum(child.time() for child in self.children()) | negative_train_query0_00137 | |
bin/sympy_time_cache.py/TreeNode/name
class TreeNode: def name(self):
return self._name | negative_train_query0_00138 | |
bin/sympy_time_cache.py/TreeNode/linearize
class TreeNode: def linearize(self):
res = [self]
for child in self.children():
res.extend(child.linearize())
return res | negative_train_query0_00139 | |
bin/sympy_time_cache.py/TreeNode/print_tree
class TreeNode: def print_tree(self, level=0, max_depth=None):
print(" "*level + str(self))
if max_depth is not None and max_depth <= level:
return
for child in self.children():
child.print_tree(level + 1, max_depth=max_dept... | negative_train_query0_00140 | |
bin/sympy_time_cache.py/TreeNode/print_generic
class TreeNode: def print_generic(self, n=50, method="time"):
slowest = sorted((getattr(node, method)(), node.name()) for node in self.linearize())[-n:]
for time, name in slowest[::-1]:
print("%s %s" % (time, name)) | negative_train_query0_00141 | |
bin/sympy_time_cache.py/TreeNode/print_slowest
class TreeNode: def print_slowest(self, n=50):
self.print_generic(n=50, method="time") | negative_train_query0_00142 | |
bin/sympy_time_cache.py/TreeNode/print_slowest_exclusive
class TreeNode: def print_slowest_exclusive(self, n=50):
self.print_generic(n, method="exclusive_time") | negative_train_query0_00143 | |
bin/sympy_time_cache.py/TreeNode/write_cachegrind
class TreeNode: def write_cachegrind(self, f):
if isinstance(f, str):
f = open(f, "w")
f.write("events: Microseconds\n")
f.write("fl=sympyallimport\n")
must_close = True
else:
must_close = Fa... | negative_train_query0_00144 | |
bin/sympy_time.py/new_import
def new_import(name, globals={}, locals={}, fromlist=[]):
global level, parent
if name in seen:
return old_import(name, globals, locals, fromlist)
seen.add(name)
import_order.append((name, level, parent))
t1 = time.time()
old_parent = parent
parent = name... | negative_train_query0_00145 | |
bin/mailmap_update.py/red
def red(text):
return "\033[31m%s\033[0m" % text | negative_train_query0_00146 | |
bin/mailmap_update.py/yellow
def yellow(text):
return "\033[33m%s\033[0m" % text | negative_train_query0_00147 | |
bin/mailmap_update.py/blue
def blue(text):
return "\033[34m%s\033[0m" % text | negative_train_query0_00148 | |
bin/mailmap_update.py/author_name
def author_name(line):
assert line.count("<") == line.count(">") == 1
assert line.endswith(">")
return line.split("<", 1)[0].strip() | negative_train_query0_00149 | |
bin/mailmap_update.py/key
def key(line):
# return lower case first address on line or
# raise an error if not an entry
if '#' in line:
line = line.split('#')[0]
L, R = line.count("<"), line.count(">")
assert L == R and L in (1, 2)
return line.split(">", 1)[0].split("<")[1].lower() | negative_train_query0_00150 | |
bin/mailmap_update.py/short_entry
def short_entry(line):
if line.count('<') == 2:
if line.split('>', 1)[1].split('<')[0].strip():
return False
return True | negative_train_query0_00151 | |
bin/generate_module_list.py/get_paths
def get_paths(level=15):
"""
Generates a set of paths for modules searching.
Examples
========
>>> get_paths(2)
['sympy/__init__.py', 'sympy/*/__init__.py', 'sympy/*/*/__init__.py']
>>> get_paths(6)
['sympy/__init__.py', 'sympy/*/__init__.py', 'sym... | negative_train_query0_00152 | |
bin/generate_module_list.py/generate_module_list
def generate_module_list():
g = []
for x in get_paths():
g.extend(glob(x))
g = [".".join(x.split("/")[:-1]) for x in g]
g = [i for i in g if not i.endswith('.tests')]
g.remove('sympy')
g = list(set(g))
g.sort()
return g | negative_train_query0_00153 | |
bin/get_sympy.py/path_hack
def path_hack():
"""
Hack sys.path to import correct (local) sympy.
"""
this_file = os.path.abspath(__file__)
sympy_dir = os.path.join(os.path.dirname(this_file), "..")
sympy_dir = os.path.normpath(sympy_dir)
sys.path.insert(0, sympy_dir)
return sympy_dir | negative_train_query0_00154 | |
bin/authors_update.py/red
def red(text):
return "\033[31m%s\033[0m" % text | negative_train_query0_00155 | |
bin/authors_update.py/yellow
def yellow(text):
return "\033[33m%s\033[0m" % text | negative_train_query0_00156 | |
bin/authors_update.py/green
def green(text):
return "\033[32m%s\033[0m" % text | negative_train_query0_00157 | |
bin/authors_update.py/author_name
def author_name(line):
assert line.count("<") == line.count(">") == 1
assert line.endswith(">")
return line.split("<", 1)[0].strip() | negative_train_query0_00158 | |
bin/authors_update.py/move
def move(l, i1, i2, who):
x = l.pop(i1)
# this will fail if the .mailmap is not right
assert who == author_name(x), \
'%s was not found at line %i' % (who, i1)
l.insert(i2, x) | negative_train_query0_00159 | |
doc/generate_logos.py/main
def main():
options, args = parser.parse_args()
if options.debug:
logging.basicConfig(level=logging.DEBUG)
fn_source = os.path.join(options.source_dir, options.source_svg)
if options.generate_svg or options.generate_all:
generate_notail_notext_versions(fn_sou... | negative_train_query0_00160 | |
doc/generate_logos.py/generate_notail_notext_versions
def generate_notail_notext_versions(fn_source, output_dir):
for ver in versions:
properties = svg_sizes[ver]
doc = load_svg(fn_source)
(notail, notext) = versionkey_to_boolean_tuple(ver)
g_tail = searchElementById(doc, "SnakeTa... | negative_train_query0_00161 | |
doc/generate_logos.py/convert_to_png
def convert_to_png(fn_source, output_dir, sizes):
svgs = list(versions)
svgs.insert(0, '')
cmd = "rsvg-convert"
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.S... | negative_train_query0_00162 | |
doc/generate_logos.py/convert_to_ico
def convert_to_ico(fn_source, output_dir, sizes):
# firstly prepare *.png files, which will be embedded
# into the *.ico files.
convert_to_png(fn_source, output_dir, sizes)
svgs = list(versions)
svgs.insert(0, '')
cmd = "convert"
p = subprocess.Popen(cm... | negative_train_query0_00163 | |
doc/generate_logos.py/versionkey_to_boolean_tuple
def versionkey_to_boolean_tuple(ver):
notail = False
notext = False
vers = ver.split("-")
notail = 'notail' in vers
notext = 'notext' in vers
return (notail, notext) | negative_train_query0_00164 | |
doc/generate_logos.py/get_svg_filename_from_versionkey
def get_svg_filename_from_versionkey(fn_source, ver):
basename = os.path.basename(fn_source)
if ver == '':
return basename
name, ext = os.path.splitext(basename)
prefix = svg_sizes[ver]["prefix"]
fn_out = "%s-%s.svg" % (name, prefix)
... | negative_train_query0_00165 | |
doc/generate_logos.py/searchElementById
def searchElementById(node, Id, tagname):
"""
Search element by id in all the children and descendants of node.
id is lower case, not ID which is usually used for getElementById
"""
nodes = node.getElementsByTagName(tagname)
for node in nodes:
an ... | negative_train_query0_00166 | |
doc/generate_logos.py/load_svg
def load_svg(fn):
doc = xml.dom.minidom.parse(fn)
return doc | negative_train_query0_00167 | |
doc/generate_logos.py/save_svg
def save_svg(fn, doc):
with open(fn, "wb") as f:
xmlstr = doc.toxml("utf-8")
f.write(xmlstr)
logging.info(" File saved: %s" % fn) | negative_train_query0_00168 | |
doc/ext/docscrape_sphinx.py/get_doc_object
def get_doc_object(obj, what=None, doc=None, config={}):
if inspect.isclass(obj):
what = 'class'
elif inspect.ismodule(obj):
what = 'module'
elif callable(obj):
what = 'function'
else:
what = 'object'
if what == 'class':
... | negative_train_query0_00169 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/__init__
class SphinxDocString: def __init__(self, docstring, config={}):
NumpyDocString.__init__(self, docstring, config=config)
self.load_config(config) | negative_train_query0_00170 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/load_config
class SphinxDocString: def load_config(self, config):
self.use_plots = config.get('use_plots', False)
self.class_members_toctree = config.get('class_members_toctree', True) | negative_train_query0_00171 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_header
class SphinxDocString: def _str_header(self, name, symbol='`'):
return ['.. rubric:: ' + name, ''] | negative_train_query0_00172 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_field_list
class SphinxDocString: def _str_field_list(self, name):
return [':' + name + ':'] | negative_train_query0_00173 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_indent
class SphinxDocString: def _str_indent(self, doc, indent=4):
out = []
for line in doc:
out += [' '*indent + line]
return out | negative_train_query0_00174 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_signature
class SphinxDocString: def _str_signature(self):
return ['']
if self['Signature']:
return ['``%s``' % self['Signature']] + ['']
else:
return [''] | negative_train_query0_00175 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_summary
class SphinxDocString: def _str_summary(self):
return self['Summary'] + [''] | negative_train_query0_00176 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_extended_summary
class SphinxDocString: def _str_extended_summary(self):
return self['Extended Summary'] + [''] | negative_train_query0_00177 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_returns
class SphinxDocString: def _str_returns(self, name='Returns'):
out = []
if self[name]:
out += self._str_field_list(name)
out += ['']
for param, param_type, desc in self[name]:
if param_type:
... | negative_train_query0_00178 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_param_list
class SphinxDocString: def _str_param_list(self, name):
out = []
if self[name]:
out += self._str_field_list(name)
out += ['']
for param, param_type, desc in self[name]:
if param_type:
... | negative_train_query0_00179 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_obj
class SphinxDocString: def _obj(self):
if hasattr(self, '_cls'):
return self._cls
elif hasattr(self, '_f'):
return self._f
return None | negative_train_query0_00180 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_member_list
class SphinxDocString: def _str_member_list(self, name):
"""
Generate a member listing, autosummary:: table where possible,
and a table where not.
"""
out = []
if self[name]:
out += ['.. rubric::... | negative_train_query0_00181 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_section
class SphinxDocString: def _str_section(self, name):
out = []
if self[name]:
out += self._str_header(name)
out += ['']
content = textwrap.dedent("\n".join(self[name])).split("\n")
out += content
... | negative_train_query0_00182 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_see_also
class SphinxDocString: def _str_see_also(self, func_role):
out = []
if self['See Also']:
see_also = super(SphinxDocString, self)._str_see_also(func_role)
out = ['.. seealso::', '']
out += self._str_indent(se... | negative_train_query0_00183 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_warnings
class SphinxDocString: def _str_warnings(self):
out = []
if self['Warnings']:
out = ['.. warning::', '']
out += self._str_indent(self['Warnings'])
return out | negative_train_query0_00184 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_index
class SphinxDocString: def _str_index(self):
idx = self['index']
out = []
if len(idx) == 0:
return out
out += ['.. index:: %s' % idx.get('default', '')]
for section, references in idx.items():
if s... | negative_train_query0_00185 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_references
class SphinxDocString: def _str_references(self):
out = []
if self['References']:
out += self._str_header('References')
if isinstance(self['References'], str):
self['References'] = [self['References']]... | negative_train_query0_00186 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/_str_examples
class SphinxDocString: def _str_examples(self):
examples_str = "\n".join(self['Examples'])
if (self.use_plots and 'import matplotlib' in examples_str
and 'plot::' not in examples_str):
out = []
out += s... | negative_train_query0_00187 | |
doc/ext/docscrape_sphinx.py/SphinxDocString/__str__
class SphinxDocString: def __str__(self, indent=0, func_role="obj"):
out = []
out += self._str_signature()
out += self._str_index() + ['']
out += self._str_summary()
out += self._str_extended_summary()
out += self._st... | negative_train_query0_00188 | |
doc/ext/docscrape_sphinx.py/SphinxFunctionDoc/__init__
class SphinxFunctionDoc: def __init__(self, obj, doc=None, config={}):
self.load_config(config)
FunctionDoc.__init__(self, obj, doc=doc, config=config) | negative_train_query0_00189 | |
doc/ext/docscrape_sphinx.py/SphinxClassDoc/__init__
class SphinxClassDoc: def __init__(self, obj, doc=None, func_doc=None, config={}):
self.load_config(config)
ClassDoc.__init__(self, obj, doc=doc, func_doc=None, config=config) | negative_train_query0_00190 | |
doc/ext/docscrape_sphinx.py/SphinxObjDoc/__init__
class SphinxObjDoc: def __init__(self, obj, doc=None, config={}):
self._f = obj
self.load_config(config)
SphinxDocString.__init__(self, doc, config=config) | negative_train_query0_00191 | |
doc/ext/numpydoc.py/mangle_docstrings
def mangle_docstrings(app, what, name, obj, options, lines,
reference_offset=[0]):
cfg = {'use_plots': app.config.numpydoc_use_plots,
'show_class_members': app.config.numpydoc_show_class_members,
'show_inherited_class_members':
... | negative_train_query0_00192 | |
doc/ext/numpydoc.py/mangle_signature
def mangle_signature(app, what, name, obj, options, sig, retann):
# Do not try to inspect classes that don't define `__init__`
if (inspect.isclass(obj) and
(not hasattr(obj, '__init__') or
'initializes x; see ' in pydoc.getdoc(obj.__init__))):
ret... | negative_train_query0_00193 | |
doc/ext/numpydoc.py/setup
def setup(app, get_doc_object_=get_doc_object):
if not hasattr(app, 'add_config_value'):
return # probably called by nose, better bail out
global get_doc_object
get_doc_object = get_doc_object_
app.connect('autodoc-process-docstring', mangle_docstrings)
app.conne... | negative_train_query0_00194 | |
doc/ext/numpydoc.py/wrap_mangling_directive
def wrap_mangling_directive(base_directive, objtype):
class directive(base_directive):
def run(self):
env = self.state.document.settings.env
name = None
if self.arguments:
m = re.match(r'^(.*\s+)?(.*?)(\(.*)?', ... | negative_train_query0_00195 | |
doc/ext/numpydoc.py/ManglingDomainBase/__init__
class ManglingDomainBase: def __init__(self, *a, **kw):
super(ManglingDomainBase, self).__init__(*a, **kw)
self.wrap_mangling_directives() | negative_train_query0_00196 | |
doc/ext/numpydoc.py/ManglingDomainBase/wrap_mangling_directives
class ManglingDomainBase: def wrap_mangling_directives(self):
for name, objtype in list(self.directive_mangling_map.items()):
self.directives[name] = wrap_mangling_directive(
self.directives[name], objtype) | negative_train_query0_00197 | |
doc/ext/numpydoc.py/directive/run
class directive: def run(self):
env = self.state.document.settings.env
name = None
if self.arguments:
m = re.match(r'^(.*\s+)?(.*?)(\(.*)?', self.arguments[0])
name = m.group(2).strip()
if not name... | negative_train_query0_00198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.