function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def Run(self):
_UninstallApk(self.devices, self.install_dict, self.args.package_name) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_LaunchUrl(self.devices, self.args.args, self.args.command_line_flags_file,
self.args.url, self.apk_helper) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
logging.warning('Installing...')
_InstallApk(self.devices, self.apk_helper, self.install_dict)
logging.warning('Sending launch intent...')
_LaunchUrl(self.devices, self.args.args, self.args.command_line_flags_file,
self.args.url, self.apk_helper) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
device_utils.DeviceUtils.parallel(self.devices).ForceStop(
self.args.package_name) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
device_utils.DeviceUtils.parallel(self.devices).ClearApplicationState(
self.args.package_name) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_ChangeFlags(self.devices, self.args.args,
self.args.command_line_flags_file) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
extra_args = shlex.split(self.args.args or '')
_RunGdb(self.devices[0], self.args.package_name, self.args.output_directory,
self.args.target_cpu, extra_args, bool(self.args.verbose_count)) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
mapping = self.args.proguard_mapping_path
if self.args.no_deobfuscate:
mapping = None
_RunLogcat(self.devices[0], self.args.package_name,
bool(self.args.verbose_count), mapping) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_RunPs(self.devices, self.args.package_name) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_RunDiskUsage(self.devices, self.args.package_name,
bool(self.args.verbose_count)) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_RunMemUsage(self.devices, self.args.package_name) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def calls_exec(self):
return not self.args.cmd | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(self):
_RunShell(self.devices, self.args.package_name, self.args.cmd) | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def _RegisterExtraArgs(self, group):
group.add_argument(
'compilation_filter',
choices=['verify', 'quicken', 'space-profile', 'space',
'speed-profile', 'speed'],
help='For WebView/Monochrome, use "speed". For other apks, use '
'"speed-profile".') | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def _ParseArgs(parser, from_wrapper_script):
subparsers = parser.add_subparsers()
commands = [clazz(from_wrapper_script) for clazz in _COMMANDS]
for command in commands:
if from_wrapper_script or not command.needs_output_directory:
command.RegisterArgs(subparsers)
# Show extended help when no command... | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def Run(output_directory, apk_path, incremental_json, command_line_flags_file,
target_cpu, proguard_mapping_path):
"""Entry point for generated wrapper scripts."""
constants.SetOutputDirectory(output_directory)
devil_chromium.Initialize(output_directory=output_directory)
parser = argparse.ArgumentParser... | chrisdickinson/nojs | [
72,
3,
72,
5,
1464475027
] |
def __init__(self, game,
key_press_handler=None,
mouse_click_handler=None,
mouse_release_handler=None,
tick_time=0,
width=600,
height=400,
key_press_handlers=None,
mouse_click_handlers=None,
mouse_release_handlers=None):
super(DefaultWind... | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def timerEvent(self, event):
self.callbacks[event.timerId() - 1]() | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def map_point_to_game_world(self, x, y):
i = int((x / self.widget.width) * self.game.world.width)
j = int(((self.widget.height - y) / self.widget.height) * self.game.world.height)
return (i, j) | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def _defaultMousePressHandler(self, event, pointer_size=5):
x, y = self.map_point_to_game_world(event.x(), event.y())
# gradually grow the pointer to be bigger to
# allow for a greater control on what is clicked
for j in xrange(pointer_size):
try:
obj = self... | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def unpause(self):
for timer, time in zip(self.timers, self.timer_times):
self.timers.start(time)
self.is_paused = False | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def mousePressEvent(self, event):
self._current_handler(self.mouse_click_handlers)(self, event) | eeue56/pycho | [
5,
1,
5,
17,
1392570857
] |
def test_between_time_formats(self, frame_or_series):
# GH#11818
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
ts = DataFrame(np.random.randn(len(rng), 2), index=rng)
ts = tm.get_obj(ts, frame_or_series)
strings = [
("2:00", "2:30"),
("0200", "023... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_localized_between_time(self, tzstr, frame_or_series):
tz = timezones.maybe_get_tz(tzstr)
rng = date_range("4/16/2012", "5/1/2012", freq="H")
ts = Series(np.random.randn(len(rng)), index=rng)
if frame_or_series is DataFrame:
ts = ts.to_frame()
ts_local = ts.... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_between_time(self, inclusive_endpoints_fixture, frame_or_series):
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
ts = DataFrame(np.random.randn(len(rng), 2), index=rng)
ts = tm.get_obj(ts, frame_or_series)
stime = time(0, 0)
etime = time(1, 0)
inclusive =... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_between_time_axis(self, frame_or_series):
# GH#8839
rng = date_range("1/1/2000", periods=100, freq="10min")
ts = Series(np.random.randn(len(rng)), index=rng)
if frame_or_series is DataFrame:
ts = ts.to_frame()
stime, etime = ("08:00:00", "09:00:00")
... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_between_time_axis_raises(self, axis):
# issue 8839
rng = date_range("1/1/2000", periods=100, freq="10min")
mask = np.arange(0, len(rng))
rand_data = np.random.randn(len(rng), len(rng))
ts = DataFrame(rand_data, index=rng, columns=rng)
stime, etime = ("08:00:00", ... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_between_time_warn(self, include_start, include_end, frame_or_series):
# GH40245
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
ts = DataFrame(np.random.randn(len(rng), 2), index=rng)
ts = tm.get_obj(ts, frame_or_series)
stime = time(0, 0)
etime = time(1, ... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def test_between_time_incompatiable_args_given(self, include_start, include_end):
# GH40245
rng = date_range("1/1/2000", "1/5/2000", freq="5min")
ts = DataFrame(np.random.randn(len(rng), 2), index=rng)
stime = time(0, 0)
etime = time(1, 0)
msg = (
"Deprecated... | pandas-dev/pandas | [
37157,
15883,
37157,
3678,
1282613853
] |
def __init__(self,
path,
identifier,
options=None,
requirements=None,
identifier_requirement=True,
sign_with_identifier=False,
entitlements=None,
verify_options=None):
"""A bui... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def __repr__(self):
return 'CodeSignedProduct(identifier={0.identifier}, ' \
'options={0.options}, path={0.path})'.format(self) | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def valid(cls, opts_to_check):
"""Tests if the specified |opts_to_check| are valid.
Args:
options: Iterable of option strings.
Returns:
True if all the options are valid, False if otherwise.
"""
if opts_to_check is None:
return True
v... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def __init__(self,
channel=None,
branding_code=None,
app_name_fragment=None,
packaging_name_fragment=None,
product_dirname=None,
creator_code=None,
channel_customize=False,
package_as_... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def base_config(self):
return base_config | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def distribution(self):
return this | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def app_product(self):
if this.channel_customize:
return '{} {}'.format(base_config.app_product,
this.app_name_fragment)
return base_config.app_product | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def base_bundle_id(self):
base_bundle_id = base_config.base_bundle_id
if this.channel_customize:
return base_bundle_id + '.' + this.channel
return base_bundle_id | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def provisioning_profile_basename(self):
profile = base_config.provisioning_profile_basename
if profile and this.channel_customize:
return '{}_{}'.format(profile, this.app_name_fragment)
return profile | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def packaging_basename(self):
if this.packaging_name_fragment:
return '{}-{}-{}'.format(
self.app_product.replace(' ', ''), self.version,
this.packaging_name_fragment)
return super(DistributionCodeSignConfig,
... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def __init__(self, input, output, work):
self._input = input
self._output = output
self._work = work | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def input(self):
return self._input | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def output(self):
return self._output | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def work(self):
return self._work | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def replace_work(self, new_work):
"""Creates a new Paths with the same input and output directories, but
with |work| set to |new_work|."""
return Paths(self.input, self.output, new_work) | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def run_check(self, url):
self.session = requests.session()
self.session.headers = [('User-agent', "Sasha's pony checkup - http://ponycheckup.com/")]
try:
homepage = self.session.get(url, timeout=7)
check_record = Check(url=url)
check_record.hsts_header_fou... | erikr/ponycheckup | [
62,
10,
62,
6,
1459590943
] |
def check_heartbleed_vuln(self, url):
try:
url = url.replace("http://", "").replace("/", "")
return bool(test_heartbleed(url))
except socket.error:
return False | erikr/ponycheckup | [
62,
10,
62,
6,
1459590943
] |
def check_runs_debug(self, url):
data = self.session.get(url+"/[][][][][]-this-tries-to-trigger-404....", timeout=7)
return "You're seeing this error because you have <code>DEBUG = True</code>" in data.content | erikr/ponycheckup | [
62,
10,
62,
6,
1459590943
] |
def check_admin(self, url):
response = self.session.get(url + "/admin", timeout=7)
if response.status_code == 404:
return (False, None)
data = response.content.lower()
admin_found = '"id_username"' in data and ("csrfmiddlewaretoken" in data or "Django" in data or "__admin_med... | erikr/ponycheckup | [
62,
10,
62,
6,
1459590943
] |
def _response_used_https(self, response):
return response.url[:5] == "https" | erikr/ponycheckup | [
62,
10,
62,
6,
1459590943
] |
def __init__(self, cube):
self._element = cube | ioam/geoviews | [
461,
68,
461,
111,
1461083221
] |
def linecontours(self, kdims=None, vdims=None, mdims=None, **kwargs):
return self(LineContours, kdims, vdims, mdims, **kwargs) | ioam/geoviews | [
461,
68,
461,
111,
1461083221
] |
def image(self, kdims=None, vdims=None, mdims=None, **kwargs):
return self(Image, kdims, vdims, mdims, **kwargs) | ioam/geoviews | [
461,
68,
461,
111,
1461083221
] |
def polygons(self, kdims=None, vdims=None, mdims=None, **kwargs):
if kdims is None: kdims = self._element.kdims
el_type = Polygons if is_geographic(self._element, kdims) else HvPolygons
return self(el_type, kdims, vdims, mdims, **kwargs) | ioam/geoviews | [
461,
68,
461,
111,
1461083221
] |
def Cell(node):
# cells must stand on own line
if node.parent.cls not in ("Assign", "Assigns"):
node.auxiliary("cell")
return "{", ",", "}" | jonathf/matlab2cpp | [
169,
58,
169,
18,
1425388832
] |
def __init__(self):
self.done = False
self.done_evt = threading.Event()
self.isExploring = False
self.progress = 0.0
self.x = 0.0
self.y = 0.0
self.z = 0.0
self.currentPoseX = 0
self.currentPoseY = 0
self.currentPoseZ = 0
self.navi... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def navigate(self):
rate = rospy.Rate(40) # 10hz
msg = SP.PoseStamped(
header=SP.Header(
frame_id="base_footprint", # no matter, plugin don't use TF
stamp=rospy.Time.now()), # stamp should update
)
while not rospy.is_shutdown():
... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def setPose(self, x, y, z, delay=0, wait=True):
self.done = False
self.x = x
self.y = y
self.z = z
self.navigating = True
if wait:
rate = rospy.Rate(5)
while not self.done and not rospy.is_shutdown():
rate.sleep()
time.sleep... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def takeoff(self, z, delay=0, wait=True):
diff = z - self.currentPoseZ
while not abs(diff)<0.2:
diff = z - self.currentPoseZ
if diff>0:
self.setPose(self.currentPoseX,self.currentPoseY,self.currentPoseZ + 1, 0, False)
else:
self.setPose... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def land(self, delay=0, wait=True):
altitude = self.currentPoseZ
while altitude > 0:
altitude = self.currentPoseZ
self.setPose(self.currentPoseX,self.currentPoseY,self.currentPoseZ - 0.5 ,2) | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def reached(self, topic):
def is_near(msg, x, y, d):
rospy.logdebug("Position %s: local: %d, target: %d, abs diff: %d",
msg, x, y, abs(x - y))
return abs(x - y) < d
self.currentPoseX = topic.pose.position.x
self.currentPoseY = topic.pose.positi... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def explore(self):
print 'explore started '
rate = rospy.Rate(30)
self.newGoal = True
if self.isExploring == False:
#Change this later when we have a better exploration
#self.isExploring = True
while self.done == False:
time.sleep(1... | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def main(args):
'''Initializes and cleanup ros node'''
rospy.init_node('dropzone_landing', anonymous=True)
d = dropzone_landing()
d.explore()
try:
rospy.spin()
except KeyboardInterrupt:
print "Shutting down ROS Image feature detector module"
cv2.destroyAllWindows() | kuri-kustar/kuri_mbzirc_challenge_3 | [
2,
3,
2,
5,
1458114537
] |
def test_plte():
qr = segno.make_qr('test')
assert qr.version < 7
dark = 'red'
buff_1 = io.BytesIO()
buff_2 = io.BytesIO()
qr.save(buff_1, kind='png', dark=dark, finder_dark=dark, version_dark='green')
qr.save(buff_2, kind='png', dark=dark)
assert buff_1.getvalue() == buff_2.getvalue() | heuer/segno | [
387,
42,
387,
12,
1470301732
] |
def test_plte3():
qr = segno.make_qr('test')
assert qr.version < 7
dark = 'red'
buff_1 = io.BytesIO()
buff_2 = io.BytesIO()
qr.save(buff_1, kind='png', dark=dark, finder_dark=dark, version_dark='green')
qr.save(buff_2, kind='png', dark=dark)
assert buff_1.getvalue() == buff_2.getvalue() | heuer/segno | [
387,
42,
387,
12,
1470301732
] |
def test_plte_micro2():
qr = segno.make_micro('RAIN')
dark = 'red'
buff_1 = io.BytesIO()
buff_2 = io.BytesIO()
qr.save(buff_1, kind='png', dark=dark, finder_dark=dark, dark_module='green')
qr.save(buff_2, kind='png', dark=dark)
assert buff_1.getvalue() == buff_2.getvalue() | heuer/segno | [
387,
42,
387,
12,
1470301732
] |
def __init__(self, source_port=0, destination_port=0, checksum=0,
payload=''):
# Call the superclass constructor
super(UDPMessage, self).__init__(payload=payload)
self.source_port = source_port
self.destination_port = destination_port
self.checksum = checksum | steffann/pylisp | [
7,
1,
7,
1,
1357508601
] |
def generate_pseudo_header(self, source, destination):
# Calculate the length of the UDP layer
udp_length = 8 + len(bytes(self.payload))
if isinstance(source, IPv4Address) \
and isinstance(destination, IPv4Address):
# Generate an IPv4 pseudo-header
header = BitSt... | steffann/pylisp | [
7,
1,
7,
1,
1357508601
] |
def verify_checksum(self, source, destination):
# An all zero transmitted checksum value means that the transmitter
# generated no checksum (for debugging or for higher level protocols
# that don't care).
if self.checksum == 0:
return True
return self.checksum == sel... | steffann/pylisp | [
7,
1,
7,
1,
1357508601
] |
def get_lisp_data_packet(self):
return self.get_lisp_message(only_data=True) | steffann/pylisp | [
7,
1,
7,
1,
1357508601
] |
def from_bytes(cls, bitstream):
'''
Parse the given packet and update properties accordingly
'''
packet = cls()
# Convert to ConstBitStream (if not already provided)
if not isinstance(bitstream, ConstBitStream):
if isinstance(bitstream, Bits):
... | steffann/pylisp | [
7,
1,
7,
1,
1357508601
] |
def __init__(self, name, dtype, dims):
self.name = name
self.dtype = dtype
self.dims = dims
self.iotype = 0
self.used_count = 0
self.index = Operand.index
Operand.index = Operand.index + 1
self.iotype2str = {Operand.IOTYPE_INPUT: 'in', Operand.IOTYPE_OUTPU... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def __str__(self):
return "{}: (name: {}, iotype: {}, dtype: {}, dims: ({},{},{},{}) used_count: {})".format(self.index,
self.name, self.iotype2str[self.iotype], self.dtype2str[self.dtype],
self.dims[0], self.dims[1], self.dims[2], self.dims[3], self.used_... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def __init__(self, graph_def, nodes, outfile, dump4tb):
self.graph_def = graph_def
self.nodes = nodes
self.outfile = outfile
self.dump4tb = dump4tb
self.layer_number = 0
self.output_names = []
self.name_node_dict = {}
self.edges = {}
self.conv_acti... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_for_tensorboard(self):
graph = tf.get_default_graph()
tf.import_graph_def(self.graph_def, name="")
tf.summary.FileWriter('/tmp/graph', graph)
print('graph saved, run "tensorboard --logdir=/tmp/graph" to see it') | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_complex_conv2d_to_file(self, node, f):
assert(node.op == 'Conv2D')
self.layer_number = self.layer_number + 1
self.converted_nodes.add(node.name)
scope_name = TFConverter.get_scope_name(node.name)
#knode for kernel, bnode for bias, dnode for dilation, anode for activatio... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_depth2space_to_file(self, node, f):
assert(node.op == 'DepthToSpace')
self.layer_number = self.layer_number + 1
block_size = node.attr['block_size'].i
np.array([self.op2code[node.op], block_size], dtype=np.uint32).tofile(f)
self.converted_nodes.add(node.name)
inp... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_maximum_to_file(self, node, f):
assert(node.op == 'Maximum')
self.layer_number = self.layer_number + 1
ynode = self.name_node_dict[node.input[1]]
y = ynode.attr['value'].tensor.float_val[0]
np.array([self.op2code[node.op]], dtype=np.uint32).tofile(f)
np.array([y]... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_layers_to_file(self, f):
for node in self.nodes:
if node.name in self.converted_nodes:
continue
# conv2d with dilation generates very complex nodes, so handle it in special
if self.in_conv2d_scope(node.name):
if node.op == 'Conv2D':
... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def dump_to_file(self):
with open(self.outfile, 'wb') as f:
f.write(header.str.encode('utf-8'))
np.array([header.major, header.minor], dtype=np.uint32).tofile(f)
self.dump_layers_to_file(f)
self.dump_operands_to_file(f)
np.array([self.layer_number, len... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def generate_output_names(self):
used_names = []
for node in self.nodes:
for input in node.input:
used_names.append(input)
for node in self.nodes:
if node.name not in used_names:
self.output_names.append(node.name) | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def generate_edges(self):
for node in self.nodes:
for input in node.input:
if input in self.edges:
self.edges[input].append(node)
else:
self.edges[input] = [node] | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def get_scope_name(name):
index = name.rfind('/')
if index == -1:
return ""
return name[0:index] | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def generate_conv2d_scope_info(self):
# mostly, conv2d is a sub block in graph, get the scope name
for node in self.nodes:
if node.op == 'Conv2D':
scope = TFConverter.get_scope_name(node.name)
# for the case tf.nn.conv2d is called directly
if s... | endlessm/chromium-browser | [
21,
16,
21,
3,
1435959644
] |
def node_name(node):
"""
Convenience function: Returns node.id, or node.name, or None
"""
return hasattr(node, 'id') and node.id or hasattr(node, 'name') and node.name | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self, name, source):
self.name = name
self.source = source
self.used = False | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __repr__(self):
return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__,
self.name,
self.source.lineno,
id(self)) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self, name, source):
self.fullName = name
name = name.split('.')[0]
super(Importation, self).__init__(name, source) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self, name, source):
super(FunctionDefinition, self).__init__(name, source)
self.signature = FunctionSignature(source) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def names(self):
"""Return a list of the names referenced by this binding."""
names = []
if isinstance(self.source, ast.List):
for node in self.source.elts:
if isinstance(node, ast.Str):
names.append(node.s)
return names | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __repr__(self):
scope_cls = self.__class__.__name__
return '<%s at 0x%x %s>' % (scope_cls, id(self), dict.__repr__(self)) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self):
Scope.__init__(self)
self.globals = self.always_used.copy() | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self, node):
self.decorated = bool(any(node.decorator_list))
self.argument_names = ast.argument_names(node)
self.default_count = len(node.args.defaults)
self.kw_only_argument_names = ast.kw_only_argument_names(node)
self.kw_only_default_count = ast.kw_only_default_co... | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def maxArgumentCount(self):
return len(self.argument_names) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def __init__(self, tree, filename='(none)', builtins=None, ignore_lines=(), **settings):
self.settings = settings
self.ignore_errors = settings.get('ignore_frosted_errors', [])
self.ignore_lines = ignore_lines
file_specific_ignores = settings.get('ignore_frosted_errors_for_' + (os.path.b... | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def defer_function(self, callable):
"""Schedule a function handler to be called just before completion.
This is used for handling function bodies, which must be deferred because code later in the file might modify
the global scope. When 'callable' is called, the scope at the time this is called... | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def run_deferred(self, deferred):
"""Run the callables in deferred using their associated scope stack."""
for handler, scope, offset in deferred:
self.scope_stack = scope
self.offset = offset
handler() | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def scope(self):
return self.scope_stack[-1] | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def check_dead_scopes(self):
"""Look at scopes which have been fully examined and report names in
them which were imported but unused."""
for scope in self.dead_scopes:
export = isinstance(scope.get('__all__'), ExportBinding)
if export:
all = scope['__all_... | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def push_function_scope(self): # XXX Deprecated
self.push_scope(FunctionScope) | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
def report(self, message_class, *args, **kwargs):
error_code = message_class.error_code
if(not error_code[:2] + "00" in self.ignore_errors and not error_code in self.ignore_errors and not
str(message_class.error_number) in self.ignore_errors):
kwargs['verbose'] = self.settings.ge... | timothycrosley/frosted | [
252,
22,
252,
11,
1390080851
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.