_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q246800 | zip_file | train | def zip_file(fn, mode="r"):
"""
returns either a zipfile.ZipFile instance or an ExplodedZipFile
instance, depending on whether fn is the name of a valid zip file,
or a directory.
"""
if isdir(fn):
return ExplodedZipFile(fn)
| python | {
"resource": ""
} |
q246801 | chunk_zip_entry | train | def chunk_zip_entry(zipfile, name, chunksize=_CHUNKSIZE):
"""
opens an entry from an openex zip file archive and yields
sequential chunks of data from the resulting stream.
"""
with open_zip_entry(zipfile, name, | python | {
"resource": ""
} |
q246802 | collect_by_typename | train | def collect_by_typename(obj_sequence, cache=None):
"""
collects objects from obj_sequence and stores them into buckets by
type name. cache is an optional dict into which we collect the
results.
"""
if cache is None:
cache = {}
for | python | {
"resource": ""
} |
q246803 | collect_by_type | train | def collect_by_type(obj_sequence, cache=None):
"""
collects objects from obj_sequence and stores them into buckets by
type. cache is an optional dict into which we collect the results.
"""
if cache is None:
cache = {}
for val in obj_sequence:
| python | {
"resource": ""
} |
q246804 | yield_sorted_by_type | train | def yield_sorted_by_type(*typelist):
"""
a useful decorator for the collect_impl method of SuperChange
subclasses. Caches the yielded changes, and re-emits them
collected by their type. The order of the types can be specified
by listing the types as arguments to this decorator. Unlisted
types wi... | python | {
"resource": ""
} |
q246805 | Change.simplify | train | def simplify(self, options=None):
"""
returns a dict describing a simple snapshot of this change, and
its children if any.
"""
simple = {
"class": type(self).__name__,
"is_change": self.is_change(),
"description": self.get_description(),
| python | {
"resource": ""
} |
q246806 | GenericChange.simplify | train | def simplify(self, options=None):
"""
provide a simple representation of this change as a dictionary
"""
# TODO: we might want to get rid of this method and just move
# it into the JSONEncoder in report.py
simple = super(GenericChange, self).simplify(options)
l... | python | {
"resource": ""
} |
q246807 | SuperChange.clear | train | def clear(self):
"""
clears all child changes and drops the reference to them
| python | {
"resource": ""
} |
q246808 | SuperChange.collect_impl | train | def collect_impl(self):
"""
instantiates each of the entries in in the overriden change_types
field with the left and right data
"""
ldata = self.get_ldata()
rdata = | python | {
"resource": ""
} |
q246809 | SuperChange.collect | train | def collect(self, force=False):
"""
calls collect_impl and stores the results as the child changes of
this super-change. Returns a tuple of the data generated from
collect_impl. Caches the result rather than re-computing each
time, unless force is True
| python | {
"resource": ""
} |
q246810 | SuperChange.check_impl | train | def check_impl(self):
"""
sets self.changes to the result of self.changes_impl, then if any
member of those checks shows as a change, will return
True,None
"""
c = False | python | {
"resource": ""
} |
q246811 | SuperChange.is_ignored | train | def is_ignored(self, options):
"""
If we have changed children and all the children which are changes
are ignored, then we are ignored. Otherwise, we are not
ignored
| python | {
"resource": ""
} |
q246812 | SuperChange.squash_children | train | def squash_children(self, options):
"""
reduces the memory footprint of this super-change by converting
all child changes into squashed | python | {
"resource": ""
} |
q246813 | add_jardiff_optgroup | train | def add_jardiff_optgroup(parser):
"""
option group specific to the tests in jardiff
"""
og = parser.add_argument_group("JAR Checking Options")
og.add_argument("--ignore-jar-entry", action="append", default=[])
og.add_argument("--ignore-jar-signature",
action="store_true", ... | python | {
"resource": ""
} |
q246814 | default_jardiff_options | train | def default_jardiff_options(updates=None):
"""
generate an options object with the appropriate default values in
place for API usage of jardiff features. overrides is an optional
dictionary which will be used to update fields on the options
object.
"""
parser = create_optparser()
| python | {
"resource": ""
} |
q246815 | main | train | def main(args=sys.argv):
"""
main entry point for the jardiff CLI
"""
| python | {
"resource": ""
} |
q246816 | add_general_report_optgroup | train | def add_general_report_optgroup(parser):
"""
General Reporting Options
"""
g = parser.add_argument_group("Reporting Options")
g.add_argument("--report-dir", action="store", default=None) | python | {
"resource": ""
} |
q246817 | add_json_report_optgroup | train | def add_json_report_optgroup(parser):
"""
Option group for the JSON report format
"""
g = parser.add_argument_group("JSON Report Options")
| python | {
"resource": ""
} |
q246818 | _indent_change | train | def _indent_change(change, out, options, indent):
"""
recursive function to print indented change descriptions
"""
show_unchanged = getattr(options, "show_unchanged", False)
show_ignored = getattr(options, "show_ignored", False)
show = False
desc = change.get_description()
if change.i... | python | {
"resource": ""
} |
q246819 | _indent | train | def _indent(stream, indent, *msgs):
""" write a message to a text stream, with indentation. Also ensures that
the output encoding of the messages is safe for writing. """
for x in range(0, indent):
stream.write(" ")
for x in msgs:
| python | {
"resource": ""
} |
q246820 | _compose_cheetah_template_map | train | def _compose_cheetah_template_map(cache):
"""
does the work of composing the cheetah template map into the given
cache
"""
from .cheetah import get_templates
# pylint: disable=W0406
# needed for introspection
import javatools
for template_type in get_templates():
if "_" no... | python | {
"resource": ""
} |
q246821 | resolve_cheetah_template | train | def resolve_cheetah_template(change_type):
"""
return the appropriate cheetah template class for the given change
type, using the method-resolution-order of the change type.
"""
tm = cheetah_template_map()
# follow the built-in MRO for a type | python | {
"resource": ""
} |
q246822 | add_html_report_optgroup | train | def add_html_report_optgroup(parser):
"""
Option group for the HTML report format
"""
g = parser.add_argument_group("HTML Report Options")
g.add_argument("--html-stylesheet", action="append",
dest="html_stylesheets", default=list())
| python | {
"resource": ""
} |
q246823 | quick_report | train | def quick_report(report_type, change, options):
"""
writes a change report via report_type to options.output or
sys.stdout
"""
report = report_type(None, options)
if options.output:
| python | {
"resource": ""
} |
q246824 | Reporter.get_relative_breadcrumbs | train | def get_relative_breadcrumbs(self):
"""
get the breadcrumbs as relative to the basedir
| python | {
"resource": ""
} |
q246825 | Reporter.add_formats_by_name | train | def add_formats_by_name(self, rfmt_list):
"""
adds formats by short label descriptors, such as 'txt', 'json', or
'html'
"""
for fmt in rfmt_list:
| python | {
"resource": ""
} |
q246826 | Reporter.subreporter | train | def subreporter(self, subpath, entry):
"""
create a reporter for a sub-report, with updated breadcrumbs and
the same output formats
"""
newbase = join(self.basedir, | python | {
"resource": ""
} |
q246827 | Reporter.setup | train | def setup(self):
"""
instantiates all report formats that have been added to this
reporter, and calls their setup methods.
"""
if self._formats:
# setup has been run already.
| python | {
"resource": ""
} |
q246828 | Reporter.run | train | def run(self, change):
"""
runs the report format instances in this reporter. Will call setup
if it hasn't been called already
"""
if self._formats is None:
self.setup() | python | {
"resource": ""
} |
q246829 | Reporter.clear | train | def clear(self):
"""
calls clear on any report format instances created during setup
and drops the cache
"""
if self._formats:
| python | {
"resource": ""
} |
q246830 | CheetahReportFormat._relative | train | def _relative(self, uri):
"""
if uri is relative, re-relate it to our basedir
"""
if uri.startswith("http:") or \
uri.startswith("https:") or \
uri.startswith("file:") or \
uri.startswith("/"):
| python | {
"resource": ""
} |
q246831 | CheetahReportFormat._relative_uris | train | def _relative_uris(self, uri_list):
"""
if uris in list are relative, re-relate them to our basedir
"""
| python | {
"resource": ""
} |
q246832 | CheetahReportFormat.setup | train | def setup(self):
"""
copies default stylesheets and javascript files if necessary, and
appends them to the options
"""
from javatools import cheetah
options = self.options
datadir = getattr(options, "html_copy_data", None)
if getattr(options, "html_data... | python | {
"resource": ""
} |
q246833 | CheetahReportFormat.run_impl | train | def run_impl(self, change, entry, out):
"""
sets up the report directory for an HTML report. Obtains the
top-level Cheetah template that is appropriate for the change
instance, and runs it.
The cheetah templates are supplied the following values:
* change - the Change i... | python | {
"resource": ""
} |
q246834 | DistInfo.get_requires | train | def get_requires(self, ignored=tuple()):
""" a map of requirements to what requires it. ignored is an
optional list of globbed patterns indicating packages,
classes, etc that shouldn't be included in the provides map"""
if self._requires is None:
self._collect_requires_provi... | python | {
"resource": ""
} |
q246835 | DistInfo.get_provides | train | def get_provides(self, ignored=tuple()):
""" a map of provided classes and class members, and what
provides them. ignored is an optional list of globbed patterns
indicating packages, classes, etc that shouldn't be included
in the provides map"""
if self._provides is None:
| python | {
"resource": ""
} |
q246836 | DistInfo.close | train | def close(self):
""" if this was a zip'd distribution, any introspection
may have resulted in opening or creating temporary files.
Call close in order to clean up. """ | python | {
"resource": ""
} |
q246837 | _unpack | train | def _unpack(struct, bc, offset=0):
"""
returns the unpacked data tuple, and the next offset past the
unpacked data
"""
| python | {
"resource": ""
} |
q246838 | _unpack_lookupswitch | train | def _unpack_lookupswitch(bc, offset):
"""
function for unpacking the lookupswitch op arguments
"""
jump = (offset % 4)
if jump:
offset += (4 - jump)
(default, npairs), offset = _unpack(_struct_ii, bc, offset)
| python | {
"resource": ""
} |
q246839 | _unpack_tableswitch | train | def _unpack_tableswitch(bc, offset):
"""
function for unpacking the tableswitch op arguments
"""
jump = (offset % 4)
if jump:
offset += (4 - jump)
| python | {
"resource": ""
} |
q246840 | _unpack_wide | train | def _unpack_wide(bc, offset):
"""
unpacker for wide ops
"""
code = ord(bc[offset])
if code == OP_iinc:
return _unpack(_struct_BHh, bc, offset)
elif code in (OP_iload, OP_fload, OP_aload, OP_lload, OP_dload,
OP_istore, OP_fstore, OP_astore, OP_lstore,
| python | {
"resource": ""
} |
q246841 | _mp_run_check | train | def _mp_run_check(tasks, results, options):
"""
a helper function for multiprocessing with DistReport.
"""
try:
for index, change in iter(tasks.get, None):
# this is the part that takes up all of our time and
# produces side-effects like writing out files for all of
... | python | {
"resource": ""
} |
q246842 | add_distdiff_optgroup | train | def add_distdiff_optgroup(parser):
"""
Option group relating to the use of a DistChange or DistReport
"""
# for the --processes default
cpus = cpu_count()
og = parser.add_argument_group("Distribution Checking Options")
og.add_argument("--processes", type=int, default=cpus,
... | python | {
"resource": ""
} |
q246843 | create_optparser | train | def create_optparser(progname=None):
"""
an OptionParser instance filled with options and groups
appropriate for use with the distdiff command
"""
from . import report
parser = ArgumentParser(prog=progname)
parser.add_argument("dist", nargs=2,
help="distributions to ... | python | {
"resource": ""
} |
q246844 | default_distdiff_options | train | def default_distdiff_options(updates=None):
"""
generate an options object with the appropriate default values in
place for API usage of distdiff features. overrides is an optional
dictionary which will be used to update fields on the options
object.
"""
parser = create_optparser()
| python | {
"resource": ""
} |
q246845 | DistChange.collect_impl | train | def collect_impl(self):
"""
emits change instances based on the delta of the two distribution
directories
"""
ld = self.ldata
rd = self.rdata
deep = not self.shallow
for event, entry in compare(ld, rd):
if deep and fnmatches(entry, *JAR_PATTE... | python | {
"resource": ""
} |
q246846 | DistReport.collect_impl | train | def collect_impl(self):
"""
overrides DistJarChange and DistClassChange from the underlying
DistChange with DistJarReport and DistClassReport instances
"""
for c in DistChange.collect_impl(self):
if isinstance(c, DistJarChange):
if c.is_change():
... | python | {
"resource": ""
} |
q246847 | DistReport.mp_check_impl | train | def mp_check_impl(self, process_count):
"""
a multiprocessing-enabled check implementation. Will create up to
process_count helper processes and use them to perform the
DistJarReport and DistClassReport actions.
"""
from multiprocessing import Process, Queue
opt... | python | {
"resource": ""
} |
q246848 | compile_struct | train | def compile_struct(fmt, cache=None):
"""
returns a struct.Struct instance compiled from fmt. If fmt has
already been compiled, it will return the previously compiled
Struct instance from the cache.
"""
if cache is None:
cache = _struct_cache | python | {
"resource": ""
} |
q246849 | BufferUnpacker.unpack | train | def unpack(self, fmt):
"""
unpacks the given fmt from the underlying buffer and returns the
results. Will raise an UnpackException if there is not enough
data to satisfy the fmt
"""
sfmt = compile_struct(fmt)
size = sfmt.size
offset = self.offset
... | python | {
"resource": ""
} |
q246850 | BufferUnpacker.unpack_struct | train | def unpack_struct(self, struct):
"""
unpacks the given struct from the underlying buffer and returns
the results. Will raise an UnpackException if there is not
enough data to satisfy the format of the structure
"""
size = struct.size
offset = self.offset
... | python | {
"resource": ""
} |
q246851 | BufferUnpacker.read | train | def read(self, count):
"""
read count bytes from the underlying buffer and return them as a
str. Raises an UnpackException if there is not enough data in
the underlying buffer.
"""
offset = self.offset
if self.data:
avail = len(self.data) - offset
... | python | {
"resource": ""
} |
q246852 | StreamUnpacker.unpack | train | def unpack(self, fmt):
"""
unpacks the given fmt from the underlying stream and returns the
results. Will raise an UnpackException if there is not enough
data to satisfy the fmt
| python | {
"resource": ""
} |
q246853 | StreamUnpacker.unpack_struct | train | def unpack_struct(self, struct):
"""
unpacks the given struct from the underlying stream and returns
the results. Will raise an UnpackException if there is not
enough data to satisfy the format of the structure
"""
size = struct.size
if | python | {
"resource": ""
} |
q246854 | StreamUnpacker.read | train | def read(self, count):
"""
read count bytes from the unpacker and return it. Raises an
UnpackException if there is not enough data in the underlying
stream.
"""
if not self.data:
| python | {
"resource": ""
} |
q246855 | StreamUnpacker.close | train | def close(self):
"""
close this unpacker, and the underlying stream if it supports such
"""
| python | {
"resource": ""
} |
q246856 | cheetah_build_py_cmd.build_template | train | def build_template(self, template, template_file, package):
"""
Compile the cheetah template in src into a python file in build
"""
try:
from Cheetah.Compiler import Compiler
except ImportError:
self.announce("unable to import Cheetah.Compiler, build fail... | python | {
"resource": ""
} |
q246857 | add_classdiff_optgroup | train | def add_classdiff_optgroup(parser):
"""
option group specific to class checking
"""
g = parser.add_argument_group("Class Checking Options")
g.add_argument("--ignore-version-up", action="store_true",
default=False)
g.add_argument("--ignore-version-down", action="store_true", ... | python | {
"resource": ""
} |
q246858 | add_general_optgroup | train | def add_general_optgroup(parser):
"""
option group for general-use features of all javatool CLIs
"""
g = parser.add_argument_group("General Options")
g.add_argument("-q", "--quiet", dest="silent",
action="store_true", default=False)
g.add_argument("-v", "--verbose", nargs=0... | python | {
"resource": ""
} |
q246859 | _iter_templates | train | def _iter_templates():
"""
uses reflection to yield the Cheetah templates under this module
"""
# pylint: disable=W0406
# needed for introspection
import javatools.cheetah
from Cheetah.Template import Template
for _, name, _ in | python | {
"resource": ""
} |
q246860 | xml_entity_escape | train | def xml_entity_escape(data):
"""
replace special characters with their XML entity versions
"""
data = data.replace("&", "&")
| python | {
"resource": ""
} |
q246861 | should_show | train | def should_show(options, member):
"""
whether to show a member by its access flags and the show
option. There's probably a faster and smarter way to do this, but
eh.
"""
show = options.show
if show == SHOW_PUBLIC:
return | python | {
"resource": ""
} |
q246862 | _unpack_annotation_val | train | def _unpack_annotation_val(unpacker, cpool):
"""
tag, data tuple of an annotation
"""
tag, = unpacker.unpack_struct(_B)
tag = chr(tag)
if tag in 'BCDFIJSZs':
data, = unpacker.unpack_struct(_H)
elif tag == 'e':
data = unpacker.unpack_struct(_HH)
elif tag == 'c':
... | python | {
"resource": ""
} |
q246863 | _pretty_annotation_val | train | def _pretty_annotation_val(val, cpool):
"""
a pretty display of a tag and data pair annotation value
"""
tag, data = val
if tag in 'BCDFIJSZs':
data = "%s#%i" % (tag, data)
elif tag == 'e':
| python | {
"resource": ""
} |
q246864 | platform_from_version | train | def platform_from_version(major, minor):
"""
returns the minimum platform version that can load the given class
version indicated by major.minor | python | {
"resource": ""
} |
q246865 | _next_argsig | train | def _next_argsig(s):
"""
given a string, find the next complete argument signature and
return it and a new string advanced past that point
"""
c = s[0]
if c in "BCDFIJSVZ":
result = (c, s[1:])
elif c == "[":
| python | {
"resource": ""
} |
q246866 | _typeseq_iter | train | def _typeseq_iter(s):
"""
iterate through all of the type signatures in a sequence
"""
s = str(s)
| python | {
"resource": ""
} |
q246867 | _pretty_type | train | def _pretty_type(s, offset=0):
# pylint: disable=R0911, R0912
# too many returns, too many branches. Not converting this to a
# dict lookup. Waiving instead.
"""
returns the pretty version of a type code
"""
tc = s[offset]
if tc == "V":
return "void"
elif tc == "Z":
... | python | {
"resource": ""
} |
q246868 | is_class_file | train | def is_class_file(filename):
"""
checks whether the given file is a Java class file, by opening it
and checking for the magic header
| python | {
"resource": ""
} |
q246869 | unpack_class | train | def unpack_class(data, magic=None):
"""
unpacks a Java class from data, which can be a string, a buffer,
or a stream supporting the read method. Returns a populated
JavaClassInfo instance.
If data is a stream which has already been confirmed to be a java
class, it may have had the first four by... | python | {
"resource": ""
} |
q246870 | JavaConstantPool.unpack | train | def unpack(self, unpacker):
"""
Unpacks the constant pool from an unpacker stream
"""
(count, ) = unpacker.unpack_struct(_H)
# first item is never present in the actual data buffer, but
# the count number acts like it would be.
items = [(None, None), ]
c... | python | {
"resource": ""
} |
q246871 | JavaConstantPool.deref_const | train | def deref_const(self, index):
"""
returns the dereferenced value from the const pool. For simple
types, this will be a single value indicating the constant.
For more complex types, such as fieldref, methodref, etc, this
will return a tuple.
"""
if not index:
... | python | {
"resource": ""
} |
q246872 | JavaAttributes.unpack | train | def unpack(self, unpacker):
"""
Unpack an attributes table from an unpacker stream. Modifies the
structure of this instance.
"""
# bound method for | python | {
"resource": ""
} |
q246873 | JavaClassInfo.unpack | train | def unpack(self, unpacker, magic=None):
"""
Unpacks a Java class from an unpacker stream. Updates the
structure of this instance.
If the unpacker has already had the magic header read off of
it, the read value may be passed via the optional magic
parameter and it will no... | python | {
"resource": ""
} |
q246874 | JavaClassInfo.get_field_by_name | train | def get_field_by_name(self, name):
"""
the field member matching name, or None if no such field | python | {
"resource": ""
} |
q246875 | JavaClassInfo.get_methods_by_name | train | def get_methods_by_name(self, name):
"""
generator of methods matching name. This will include any bridges
present.
| python | {
"resource": ""
} |
q246876 | JavaClassInfo.get_method | train | def get_method(self, name, arg_types=()):
"""
searches for the method matching the name and having argument type
descriptors matching those in arg_types.
Parameters
==========
arg_types : sequence of strings
each string is a parameter type, in the non-pretty fo... | python | {
"resource": ""
} |
q246877 | JavaClassInfo.get_method_bridges | train | def get_method_bridges(self, name, arg_types=()):
"""
generator of bridge methods found that adapt the return types of a
named method and having argument type descriptors matching
those in arg_types.
"""
for m in | python | {
"resource": ""
} |
q246878 | JavaClassInfo.get_sourcefile | train | def get_sourcefile(self):
"""
the name of thie file this class was compiled from, or None if not
indicated
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.10
""" # noqa
buff = self.get_attribute("SourceFile")
if buff is None: | python | {
"resource": ""
} |
q246879 | JavaClassInfo.get_innerclasses | train | def get_innerclasses(self):
"""
sequence of JavaInnerClassInfo instances describing the inner
classes of this class definition
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6
| python | {
"resource": ""
} |
q246880 | JavaClassInfo._pretty_access_flags_gen | train | def _pretty_access_flags_gen(self):
"""
generator of the pretty access flags
"""
if self.is_public():
yield "public"
if self.is_final():
yield "final"
if self.is_abstract():
yield "abstract"
| python | {
"resource": ""
} |
q246881 | JavaClassInfo.pretty_descriptor | train | def pretty_descriptor(self):
"""
get the class or interface name, its accessor flags, its parent
class, and any interfaces it implements
"""
f = " ".join(self.pretty_access_flags())
if not self.is_interface():
f += " class"
| python | {
"resource": ""
} |
q246882 | JavaClassInfo._get_provides | train | def _get_provides(self, private=False):
"""
iterator of provided classes, fields, methods
"""
# TODO I probably need to add inner classes here
me = self.pretty_this()
yield me
for field in self.fields:
if | python | {
"resource": ""
} |
q246883 | JavaClassInfo._get_requires | train | def _get_requires(self):
"""
iterator of required classes, fields, methods, determined my
mining the constant pool for such types
"""
provided = set(self.get_provides(private=True))
cpool = self.cpool
# loop through the constant pool for API types
for i,... | python | {
"resource": ""
} |
q246884 | JavaClassInfo.get_provides | train | def get_provides(self, ignored=tuple(), private=False):
"""
The provided API, including the class itself, its fields, and its
methods.
"""
if private:
if self._provides_private is None:
self._provides_private = set(self._get_provides(True))
... | python | {
"resource": ""
} |
q246885 | JavaClassInfo.get_requires | train | def get_requires(self, ignored=tuple()):
"""
The required API, including all external classes, fields, and
methods that this class references
"""
if self._requires is None:
self._requires | python | {
"resource": ""
} |
q246886 | JavaMemberInfo.unpack | train | def unpack(self, unpacker):
"""
unpack the contents of this instance from the values in unpacker
"""
| python | {
"resource": ""
} |
q246887 | JavaMemberInfo.get_annotationdefault | train | def get_annotationdefault(self):
"""
The AnnotationDefault attribute, only present upon fields in an
annotaion.
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.20
| python | {
"resource": ""
} |
q246888 | JavaMemberInfo.get_code | train | def get_code(self):
"""
the JavaCodeInfo of this member if it is a non-abstract method,
None otherwise
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.3
""" # noqa
buff = self.get_attribute("Code")
if buff is None: | python | {
"resource": ""
} |
q246889 | JavaMemberInfo.get_exceptions | train | def get_exceptions(self):
"""
a tuple of class names for the exception types this method may
raise, or None if this is not a method
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.5
""" # noqa
buff = self.get_attribute("Exceptions")
... | python | {
"resource": ""
} |
q246890 | JavaMemberInfo.get_constantvalue | train | def get_constantvalue(self):
"""
the constant pool index for this field, or None if this is not a
contant field
reference: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.2
| python | {
"resource": ""
} |
q246891 | JavaMemberInfo.get_arg_type_descriptors | train | def get_arg_type_descriptors(self):
"""
The parameter type descriptor list for a method, or None for a
field. Type descriptors are shorthand identifiers for the
builtin java types.
"""
if not self.is_method: | python | {
"resource": ""
} |
q246892 | JavaMemberInfo.pretty_arg_types | train | def pretty_arg_types(self):
"""
Sequence of pretty argument types.
"""
if self.is_method:
types = self.get_arg_type_descriptors()
| python | {
"resource": ""
} |
q246893 | JavaMemberInfo.pretty_descriptor | train | def pretty_descriptor(self):
"""
assemble a long member name from access flags, type, argument
types, exceptions as applicable
"""
f = " ".join(self.pretty_access_flags())
p = self.pretty_type()
n = self.get_name()
t = ",".join(self.pretty_exceptions())
... | python | {
"resource": ""
} |
q246894 | JavaMemberInfo.pretty_identifier | train | def pretty_identifier(self):
"""
The pretty version of get_identifier
"""
ident = self.get_name()
| python | {
"resource": ""
} |
q246895 | JavaCodeInfo.unpack | train | def unpack(self, unpacker):
"""
unpacks a code block from a buffer. Updates the internal structure
of this instance
"""
(a, b, c) = unpacker.unpack_struct(_HHI)
self.max_stack = a
self.max_locals = b
self.code = unpacker.read(c)
| python | {
"resource": ""
} |
q246896 | JavaCodeInfo.get_line_for_offset | train | def get_line_for_offset(self, code_offset):
"""
returns the line number given a code offset
"""
prev_line = 0
for (offset, line) in self.get_linenumbertable():
if offset < code_offset:
prev_line = | python | {
"resource": ""
} |
q246897 | JavaExceptionInfo.unpack | train | def unpack(self, unpacker):
"""
unpacks an exception handler entry in an exception table. Updates
the internal structure of this instance
"""
(a, b, c, d) = unpacker.unpack_struct(_HHHH)
| python | {
"resource": ""
} |
q246898 | JavaExceptionInfo.info | train | def info(self):
"""
tuple of the start_pc, end_pc, handler_pc and catch_type_ref
"""
| python | {
"resource": ""
} |
q246899 | JavaInnerClassInfo.unpack | train | def unpack(self, unpacker):
"""
unpack this instance with data from unpacker
"""
(a, b, c, d) = unpacker.unpack_struct(_HHHH)
self.inner_info_ref | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.